placing static library answer in the beginning of flash section

前端 未结 1 907
无人共我
无人共我 2021-01-14 19:33

I\'m using atmelstudio to compile a firmware image and want to place the functions from static libraries (including the gnu\'s libc.a & libgcc.a) in the beginning of the

相关标签:
1条回答
  • 2021-01-14 19:53

    The star in *(.text), means to match any object file. You need to give the name for the libc and put it first. These are called input sections in the gnu ld manual. The syntax according to the manual is libc.a:(.text), you may order specific objects within a library, with libc.a:strcmp.o(.text).

    See: Gnu Ld section 3.6.4.1 Input Section Basics for detailed information.


    A solutions might be,

    KEEP(*(.vectors .vectors.)) 
    .a:(.text .text. .rodata .rodata*) <-- this line 
    *(.text .text. .gnu.linkonce.t.*) 
    *(.glue_7t) *(.glue_7) 
    *(.rodata .rodata .gnu.linkonce.r.*)
    
    0 讨论(0)
提交回复
热议问题