https://sourceware.org/bugzilla/show_bug.cgi?id=16417
--- Comment #9 from Cary Coutant <ccoutant at google dot com> --- "Normally the linker will add a DT_NEEDED tag for each dynamic library mentioned on the command line, regardless of whether the library is actually needed or not. --as-needed causes a DT_NEEDED tag to only be emitted for a library that at that point in the link [a] satisfies a non-weak undefined symbol reference from a regular object file or, [b] if the library is not found in the DT_NEEDED lists of other libraries, a non-weak undefined symbol reference from another dynamic library." Case [a] is not satisfied here, since there is no reference to libpthread from a regular object file. Case [b] is related to one of the major differences between BFD ld and gold: gold does not track DT_NEEDED lists from shared libraries, so it does not check for this case. I'm still a bit puzzled as to why there's a weak reference to libpthread in the first place. And if there's a weak references, why isn't the code prepared to deal with it remaining unresolved? This seems like an artificial test case to me. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils