diff options
Diffstat (limited to 'lld/ELF/LTO.cpp')
| -rw-r--r-- | lld/ELF/LTO.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp index cc570f1f82e..6d2be054813 100644 --- a/lld/ELF/LTO.cpp +++ b/lld/ELF/LTO.cpp @@ -82,10 +82,15 @@ void BitcodeCompiler::add(BitcodeFile &F) { Keep.push_back(GV); continue; } - if (!BitcodeFile::shouldSkip(Sym)) + 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)) Keep.push_back(GV); + } } Mover.move(Obj->takeModule(), Keep, |

