From: Davide Italiano Date: Wed, 23 Mar 2016 17:59:07 +0000 (+0000) Subject: [LTO] Only change linkage if we keep the symbol. X-Git-Tag: llvmorg-3.9.0-rc1~11146 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f20a55fcfd033e7a171bcdefa7e92fc758975fe4;p=platform%2Fupstream%2Fllvm.git [LTO] Only change linkage if we keep the symbol. llvm-svn: 264171 --- diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp index 6d2be05..ab97079 100644 --- a/lld/ELF/LTO.cpp +++ b/lld/ELF/LTO.cpp @@ -83,13 +83,12 @@ void BitcodeCompiler::add(BitcodeFile &F) { continue; } if (!BitcodeFile::shouldSkip(Sym)) { - - if (GV->getLinkage() == llvm::GlobalValue::LinkOnceODRLinkage) - GV->setLinkage(GlobalValue::WeakODRLinkage); - if (SymbolBody *B = Bodies[BodyIndex++]) - if (&B->repl() == B && isa(B)) + if (&B->repl() == B && isa(B)) { + if (GV->getLinkage() == llvm::GlobalValue::LinkOnceODRLinkage) + GV->setLinkage(GlobalValue::WeakODRLinkage); Keep.push_back(GV); + } } }