[PATCH] D17975: [lto] Avoid duplicate symbol error for appending linkage.
Sean Silva via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 8 17:09:36 PST 2016
silvas created this revision.
silvas added a reviewer: rafael.
silvas added subscribers: llvm-commits, Bigcheese.
Herald added a subscriber: joker.eph.
I'm not sure if this is the right solution, since it seems like we need
to do something more with @llvm.global_ctors in
SymbolTable.cpp:addBitcodeFile.
Any ideas?
http://reviews.llvm.org/D17975
Files:
ELF/InputFiles.cpp
test/ELF/lto/linkage.ll
Index: test/ELF/lto/linkage.ll
===================================================================
--- test/ELF/lto/linkage.ll
+++ test/ELF/lto/linkage.ll
@@ -7,3 +7,9 @@
; Should not encounter a duplicate symbol error for @.str
@.str = private unnamed_addr constant [4 x i8] c"Hey\00", align 1
+
+; Should not encounter a duplicate symbol error for @llvm.global_ctors
+ at llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @ctor, i8* null }]
+define internal void @ctor() {
+ ret void
+}
Index: ELF/InputFiles.cpp
===================================================================
--- ELF/InputFiles.cpp
+++ ELF/InputFiles.cpp
@@ -446,6 +446,8 @@
continue;
if (!(Flags & object::BasicSymbolRef::SF_Global))
continue;
+ if (GV->getLinkage() == GlobalValue::AppendingLinkage)
+ continue;
uint8_t Visibility = getGvVisibility(GV);
SmallString<64> Name;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17975.50091.patch
Type: text/x-patch
Size: 959 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160309/d18aa75d/attachment.bin>
More information about the llvm-commits
mailing list