[arm-gnu] undefined reference to _init

David Brown david at westcontrol.com
Mon Oct 29 09:58:35 UTC 2012


On 27/10/2012 16:43, Carlos O'Donell wrote:
> On 10/27/2012 9:58 AM, Brad Badke wrote:
>> I downloaded the required libraries and my app/rtos runs as fast with
>> GCC as it does with ARM rvds4.1. Slightly bigger binary though.
>> Thanks
>
> Glad to hear that!
>
> You might want to look into using -ffunction-sections -fdata-sections
> when compiling and then have the linker garbage collect unused sections
> with -Wl,--gc-sections.
>
> You need to be careful though because the linker will discard sections
> that you might only have indirectly referenced.
>
> It's always good to look at the link map (-Wl,-Map,linkermap.txt) and
> see exactly what was discarded and use KEEP() in your linker script
> to keep those things you know you need.
>
> Cheers,
> Carlos.
>

Link-time optimisation can also reduce the binary size somewhat (and 
speed up some kinds of code), but you can get other linking issues, and 
it can make debugging "entertaining".

mvh.,

David




More information about the arm-gnu mailing list