More agressive entity removal during linking

Jason Gunthorpe jgg@ualberta.ca
Wed Dec 8 23:02:00 GMT 1999


Hi,

I have a m68k embedded target I have been working on, and I noticed that
ld links the entire contents of a .o file (even if that .o is in a library
archive) even if only a small number of symbols in that .o file are
referenced.

Given the restricted memory in my system I am interested in optimizing
this, ideally ld would only include an entity if it was referenced by an
already included entity.

I've read through the linker reference and it seems to me there are no
flags to enable a size optimization like this - the only way seems to be
to put 1 function/variable per .c file :<

Am I overlooking something or is this impossible? My target is m69k-rtems,
(coff) egcs-2.91.66, GNU ld version 2.9.5 (with BFD 2.9.5.0.12)

Thanks,
Jason



More information about the Gcc mailing list