[llvm-bugs] [Bug 32603] New: [lld-link] Spourious duplicate symbol error
llvm-bugs at lists.llvm.org
Mon Apr 10 10:53:32 PDT 2017
Bug ID: 32603
Summary: [lld-link] Spourious duplicate symbol error
OS: Windows NT
Assignee: unassignedbugs at nondot.org
Reporter: Alberto.Magni at microsoft.com
CC: llvm-bugs at lists.llvm.org
Created attachment 18261
Reproducer and possible fix.
We have noticed an inconsistency between the link.exe and lld-link.exe
Consider this example:
foo1.ll defines a function foo
foo2.ll defines a function foo
main.ll contains main that calls foo
foo1.ll is assembled into an object file and then into a library
foo2.ll is assembled into an object file
The following command currently fails:
lld-link.exe foo1.lib main.obj foo2.obj
The error is: duplicate symbol: foo
While the same invocation works with link.exe
This is because link processes all .obj files in input first and resorts to
.lib inputs only if there are unresolved symbols.
Since the symbol foo is found in the .obj the library is ignored and no error
A reproducer for this bug is attached in the format of an LLVM test.
The same diff file contains a possible fix.
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