https://bugs.llvm.org/show_bug.cgi?id=32603
Bug ID: 32603
Summary: [lld-link] Spourious duplicate symbol error
Product: lld
Version: unspecified
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: COFF
Assignee: unassignedb...@nondot.org
Reporter: alberto.ma...@microsoft.com
CC: llvm-bugs@lists.llvm.org
Created attachment 18261
--> https://bugs.llvm.org/attachment.cgi?id=18261&action=edit
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
is reported.
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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs