ffunction-sections ARM thumb mode

Nick Winters nick@wintersteam.org
Fri Feb 11 13:24:00 GMT 2011

To improve efficiency I decided to enable -function-sections when
compiling newlib for ARM thumb mode with interworking enabled. As a
result I received the following error:

   symbol _start_thumb is in a different section

The following is a diff on the /src/libgloss/arm/linux-crt0.c file to
force the _start_thumb into the .text section:

Index: linux-crt0.c
RCS file: /cvs/src/src/libgloss/arm/linux-crt0.c,v
retrieving revision 1.2
diff -r1.2 linux-crt0.c
< __attribute__((naked, used))
> /* Force _start_thumb in the .text section so this will still compile when
>  * enabling -ffunction-sections.
>  */
> __attribute__((naked, used)) __attribute__((section(".text")))


More information about the Newlib mailing list