bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/23499] Incorrect code in bfd_elf_record_link_assignment


From: address@hidden
Subject: [Bug ld/23499] Incorrect code in bfd_elf_record_link_assignment
Date: Fri, 24 Jul 2020 14:21:34 +0000

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

Samuel Thibault <samuel.thibault@ens-lyon.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |samuel.thibault@ens-lyon.or
                   |                            |g

--- Comment #12 from Samuel Thibault <samuel.thibault@ens-lyon.org> ---
Hello,

It seems we are getting the same kind of issue with the gold linker. For
various reasons llvm-toolchain is linked with gold in Debian, and I stumbled on
this:

/usr/bin/ld: /usr/lib/llvm-9/lib/../lib/libLLVM-9.so.1:(*IND*+0x0): multiple
definition of `_end'

(full log in
https://buildd.debian.org/status/fetch.php?pkg=qttools-opensource-src&arch=hurd-i386&ver=5.14.2-2&stamp=1595261986&raw=0
)

and indeed

$ nm -D /usr/lib/llvm-9/lib/libLLVM-9.so.1 | grep ' _end'
03d0ef69 B _end@@LLVM_9
03d0ef69 B _end@LLVM_9

where _end@LLVM_9 is unwanted.


I reduced the test case to a mere

$ cat test.cpp
int i;
$ cat test.map 
LLVM_9 { global: *; };
$ clang++-9 -fuse-ld=gold -shared test.cpp -o libtest.so
-Wl,--version-script,test.map -lz3

Note the -lz3:

$ nm -D /usr/lib/i386-gnu/libz3.so | grep ' _end'
018bb074 B _end

It's the combination of -fuse-ld=gold, the version script, and the fact that we
link against a library that also has its (unversioned) _end symbol, that leads
to this:

$ nm -D libtest.so | grep _end
00002010 D _end@@LLVM_9
00002010 D _end@LLVM_9

where _end@LLVM_9 is unwanted, and would typically produce the multiple
definition mentioned above.

Samuel

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