[lto] Avoid duplicate symbol error for appending linkage.

Summary:
Is there any other code needed for correctly handling appending linkage?
Do we need to do something more with @llvm.global_ctors in
SymbolTable.cpp:addBitcodeFile; otherwise the combined bitcode module
won't have all the global ctors.

Reviewers: rafael

Subscribers: Bigcheese, llvm-commits, joker.eph

Differential Revision: http://reviews.llvm.org/D17975

llvm-svn: 262992
This commit is contained in:
Sean Silva 2016-03-09 03:42:39 +00:00
parent 96e1479326
commit 7255d0b068
2 changed files with 8 additions and 0 deletions

View File

@ -446,6 +446,8 @@ void BitcodeFile::parse(DenseSet<StringRef> &ComdatGroups) {
continue;
if (!(Flags & BasicSymbolRef::SF_Global))
continue;
if (Flags & BasicSymbolRef::SF_FormatSpecific)
continue;
uint8_t Visibility = getGvVisibility(GV);
SmallString<64> Name;

View File

@ -7,3 +7,9 @@ target triple = "x86_64-unknown-linux-gnu"
; 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
@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
}