ld includes entire archive (.a) when compiling .elf file

Daniel Jacobowitz drow@false.org
Fri Mar 10 22:29:00 GMT 2006


On Fri, Mar 10, 2006 at 04:57:26PM -0500, Josh Keller wrote:
> I can't figure out what to do.  I have tried the --gc-sections option
> and the --no-whole-archive option but I still get a really large
> executable.  I created my archive from .o files using 
> arm-elf-ar -rcv libucos_ii.a $(OBJS).  
> 
> I can't seem to figure out a good solution.  Any ideas?  I'd rather not
> create an archive file for each .o file (which sort of defeats the
> purpose of having a .a file)  Thanks for the help!

Please try using the -Map option to ld (-Wl,-Map,filename if you're
using GCC).  That will tell you why each file is pulled in.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Binutils mailing list