[llvm-bugs] [Bug 33383] New: Linking static library does not resolve symbols as gold/ld
llvm-bugs at lists.llvm.org
Fri Jun 9 05:17:17 PDT 2017
Bug ID: 33383
Summary: Linking static library does not resolve symbols as
Assignee: unassignedbugs at nondot.org
Reporter: clang at martinien.de
CC: llvm-bugs at lists.llvm.org
Created attachment 18602
[ This is spawned from an earlier email thread, see here:
and reply from Rui:
I finally managed to come up with a reduced example, please find it
attached. You need to have GOLDPATH and LLDPATH set to point to the
What happens in build.sh is that an object file is partially linked ("-u")
with gold first, then this is linked with lld to another object file for
the final executable. The resulting executable 'repro' then crashes during
The following changes make it work:
1) Using ld instead of gold for the first step
2) Using ld or gold for the second step
2) makes me think there must be something those linkers are doing, but lld
is not, that makes the whole thing work. But note that the crash happens
in a constructor. I found this for the "-u" option in the ld manpage here:
"When linking C++ programs, this option will not resolve references to
constructors; to do that, use -Ur."
However, gold does not know that option (and ld already works without it)
Any idea what is going wrong here?
Thanks and best regards
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-bugs