bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/27441] Small inconsistency in between gold and bfd


From: matz at suse dot de
Subject: [Bug ld/27441] Small inconsistency in between gold and bfd
Date: Mon, 08 Mar 2021 13:46:45 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=27441

--- Comment #17 from Michael Matz <matz at suse dot de> ---
(In reply to Fangrui Song from comment #16)
> (In reply to Alan Modra from comment #12)
> > (In reply to Michael Matz from comment #11)
> > > Yes, I thought so as well, until I read ELF.txt again :)
> > 
> > Huh, I can hardly believe I was making such a completely wrong assumption. 
> > How stupid is that?  I just checked elflink.c plus archive.c code and ran a
> > test to properly convince myself I was wrong.  Yes, a weak definition does
> > indeed cause an archive element to be extracted to satisfy a strong
> > undefined reference.
> > 
> > Testing the binding of the definition was just plain wrong.
> 
> My understanding of when a shared object is needed:
> 
> * it is linked at least once in --no-as-needed mode (i.e. --as-needed a.so
> --no-as-needed a.so => needed)
> * or it has a non-weak definition resolving a reference from a live section
> (not discarded by --gc-sections)
> 
> I think both LLD and gold's rules are like this.

Then they both have the same bug (in the second item of your list).  As Alan
explains, as-needed behaviour intends to reflect behaviour of static archives
(where that applies; here any difference in behaviour doesn't seem useful).

The only thing about weak definitions is that there may be validly multiple
ones
without error (the first one or the single non-weak definition wins).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]