This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: RFC: linker enhancements
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 17 Mar 2004 22:41:49 +1030
- Subject: Re: RFC: linker enhancements
- References: <20031212112448.GI12344@sunsite.ms.mff.cuni.cz> <87wu92xan5.fsf@egil.codesourcery.com> <20031212142914.GK12344@sunsite.ms.mff.cuni.cz> <20040317042418.GZ15900@bubble.modra.org> <20040317063116.GA6393@sunsite.ms.mff.cuni.cz>
On Wed, Mar 17, 2004 at 07:31:16AM +0100, Jakub Jelinek wrote:
> > One side-effect of this patch is that when --only-if-needed is in
> > effect, weak definitions in normal files won't be overridden by
> > a strong definition in a shared library. I'm not sure whether that's
> > a bug or a feature..
>
> Only if the library is not included, or when it is actually needed as well?
Potentially both cases. elf_link_add_object_symbols won't use a strong
definition in the lib in preference to a weak definition in a regular
file until some other definition is needed from the library. At that
point, further weak definitions in regular objects will be overridden.
That's not new behaviour, but what we've had for quite a while when
linking in shared libs brought in via a DT_NEEDED tag in some other
shared lib.
Fixing this requires two passes over the lib, or keeping a list of weak
regular syms that might need to be fixed up later.
--
Alan Modra
IBM OzLabs - Linux Technology Centre