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 .text section followed .text belong to my project source code. Right now what happen is the other way around.
This is my linker script
. = ALIGN(4);
_sfixed = .;
KEEP(*(.vectors .vectors.*))
*(.text .text.* .gnu.linkonce.t.*) <-- my functions and functions from static libraries are within this rule
*(.glue_7t) *(.glue_7)
*(.rodata .rodata* .gnu.linkonce.r.*)
*(.ARM.extab* .gnu.linkonce.armextab.*)
KEEP(*(.vectors .vectors.*)) *.a:(.text .text.* .rodata .rodata*) <-- this line *(.text .text.* .gnu.linkonce.t.*) *(.glue_7t) *(.glue_7) *(.rodata .rodata* .gnu.linkonce.r.*)
– Va1iant Mar 19 '14 at 21:59