[llvm-bugs] [Bug 46676] Undefined symbol in dynamic library on the lld link line causes inaccurate symbol resolution

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Jul 14 22:18:00 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46676

Fangrui Song <i at maskray.me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
                 CC|                            |i at maskray.me

--- Comment #1 from Fangrui Song <i at maskray.me> ---
Hi Andrew,

I think this is another instance that lack of SHT_GNU_verneed support caused
issues (https://bugs.llvm.org/show_bug.cgi?id=44842 ) 

libsymbol_wrapper.so has an undefined symbol shadowed at LIB_GOOD_API_1
LLD older than https://reviews.llvm.org/D80059 treated it as unversioned
shadowed and fetched libbad_symbol.a(bad_symbol.o)
LLD newer than D80059, GNU ld and gold do not fetch
libbad_symbol.a(bad_symbol.o)

% clang -shared -o libsymbol_user.so symbol_user.o libsymbol_wrapper.so
libbad_symbol.a -fuse-ld=gold -Wl,--trace-symbol,shadowed -Wl,-rpath,.
-fuse-ld=lld
libsymbol_wrapper.so: reference to shadowed
libbad_symbol.a(bad_symbol.o): definition of shadowed

% clang -shared -o libsymbol_user.so symbol_user.o libsymbol_wrapper.so
libbad_symbol.a -Wl,-y,shadowed at LIB_GOOD_API_1 -Wl,-rpath,. -fuse-ld=bfd 
/usr/bin/ld.bfd: libsymbol_wrapper.so: reference to shadowed at LIB_GOOD_API_1


https://reviews.llvm.org/rGe32f04cdc95224589f30148599c362ba37bae7b6 fixed the
bug.  Unfortunately the commit is not in 10.0.1-rc4

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200715/ebf7cf15/attachment.html>


More information about the llvm-bugs mailing list