[arm-gnu] undefined reference to _init

Carlos O'Donell carlos_odonell at mentor.com
Sat Oct 27 14:43:27 UTC 2012


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.
-- 
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell at mentor.com
carlos at codesourcery.com
+1 (613) 963 1026



More information about the arm-gnu mailing list