This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: How should the GNU linker treat weak references?
- To: Ulrich Drepper <drepper at redhat dot com>
- Subject: Re: How should the GNU linker treat weak references?
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Mon, 2 Jul 2001 12:27:45 -0700
- Cc: Mark Kettenis <kettenis at wins dot uva dot nl>,binutils at sources dot redhat dot com, gcc at gcc dot gnu dot org
- References: <200107021825.f62IP6U12303@delius.kettenis.local> <m3wv5r884e.fsf@otr.mynet>
On Mon, Jul 02, 2001 at 12:05:05PM -0700, Ulrich Drepper wrote:
>
> Nope, but I also don't agree with the current behavior.
>
> What should happen is that the linker recognizes that the undefined
> reference comes from a DSO which was included by DT_NEEDED and in this
> case it should not include a DT_NEEDED in the program itself.
>
But in Mark's case, it is crtbegin.o contains a weak reference to
__register_frame_info_bases, which has a definition in the shared
libgcc. Do we treat weak reference the same as undefined when dealing
with DT_NEEDED?
>
> The goal for ld must be to be as close to the ld.so behavior as
> possible to reduce surprises and to not change the user's intentions
> (see point a) above which is something which can truly be
> catastrophic).
Agreed.
H.J.