[LTO] Only change linkage if we keep the symbol.

llvm-svn: 264171
This commit is contained in:
Davide Italiano 2016-03-23 17:59:07 +00:00
parent 084c912499
commit f20a55fcfd
1 changed files with 4 additions and 5 deletions

View File

@ -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<DefinedBitcode>(B))
if (&B->repl() == B && isa<DefinedBitcode>(B)) {
if (GV->getLinkage() == llvm::GlobalValue::LinkOnceODRLinkage)
GV->setLinkage(GlobalValue::WeakODRLinkage);
Keep.push_back(GV);
}
}
}