summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LTO.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/LTO.cpp')
-rw-r--r--lld/ELF/LTO.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp
index ab97079bbd8..7197227a25a 100644
--- a/lld/ELF/LTO.cpp
+++ b/lld/ELF/LTO.cpp
@@ -85,8 +85,16 @@ void BitcodeCompiler::add(BitcodeFile &F) {
if (!BitcodeFile::shouldSkip(Sym)) {
if (SymbolBody *B = Bodies[BodyIndex++])
if (&B->repl() == B && isa<DefinedBitcode>(B)) {
- if (GV->getLinkage() == llvm::GlobalValue::LinkOnceODRLinkage)
+ switch (GV->getLinkage()) {
+ default:
+ break;
+ case llvm::GlobalValue::LinkOnceAnyLinkage:
+ GV->setLinkage(GlobalValue::WeakAnyLinkage);
+ break;
+ case llvm::GlobalValue::LinkOnceODRLinkage:
GV->setLinkage(GlobalValue::WeakODRLinkage);
+ break;
+ }
Keep.push_back(GV);
}
}
OpenPOWER on IntegriCloud