This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Where is the dead symbol eliminator patch?
On Sat, Jul 30, 2005 at 05:34:55PM -0700, Ian Lance Taylor wrote:
> Mike Hearn <mike@plan99.net> writes:
>
> > 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'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?
>
> I don't know what Apple has done.
>
> What you want to do is compile with -ffunction-sections and link with
> --gc-sections.
But that is NOT going to accomplish what you want, Mike. If you want
to be compatible with version 2.4, link against version 2.4. There's
no safe way around this.
--
Daniel Jacobowitz
CodeSourcery, LLC