Where is the dead symbol eliminator patch?

Mike Hearn mike@plan99.net
Sat Jul 30 23:11:00 GMT 2005


Hi,

When static linking a library, my copy of ld (Fedora Core 4, version
binutils-2.15.94.0.2.2-2.1) seems to drop .o files that don't contain any
used symbols - this is good. Unfortunately, only one symbol from that file
being used is enough to link in the entire .o file, which is bad.

I'm not too worried about efficiency here, a bigger problem is binary
portability. This is hitting the Inkscape guys hard right now. The problem
is that the developers are statically linking GTKmm 2.6, but Inkscape only
actually uses GTK+ 2.4. It was believed that because no GTK+ 2.6 features
were used, only the 2.4 binding symbols would be statically linked in from
GTKmm, but actually that isn't true: because of this file level
granularity in ld other symbols they don't use are statically linked in,
giving the final binaries an unexpected hard dependency on glib 2.6

This particular problem is easily fixed by asking developers to statically
link against the 2.4 bindings only. But, this would never have happened if
unused symbols were dropped entirely.

I've been told Apple have written a patch to make this happen. Is this
true? If so, does anybody know where I can find it?

thanks -mike



More information about the Binutils mailing list