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: i at maskray dot me
Subject: [Bug ld/27441] Small inconsistency in between gold and bfd
Date: Fri, 05 Mar 2021 08:03:54 +0000

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

Fangrui Song <i at maskray dot me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |i at maskray dot me

--- Comment #16 from Fangrui Song <i at maskray dot me> ---
(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.

-- 
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]