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.