Index: ELF/InputFiles.cpp =================================================================== --- ELF/InputFiles.cpp +++ ELF/InputFiles.cpp @@ -446,6 +446,8 @@ continue; if (!(Flags & object::BasicSymbolRef::SF_Global)) continue; + if (Flags & object::BasicSymbolRef::SF_FormatSpecific) + continue; uint8_t Visibility = getGvVisibility(GV); SmallString<64> Name; 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 +@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 +}