Index: ELF/SymbolTable.cpp =================================================================== --- ELF/SymbolTable.cpp +++ ELF/SymbolTable.cpp @@ -99,6 +99,9 @@ // Compile bitcode files. Lto.reset(new BitcodeCompiler); + for (auto &F : ObjectFiles) + for (auto S : F->getSymbols()) + S->repl().setUsedInRegularObj(); for (const std::unique_ptr &F : BitcodeFiles) Lto->add(*F); std::unique_ptr IF = Lto->compile(); @@ -112,6 +115,8 @@ Sym->Body->setUsedInRegularObj(); if (!Sym->Body->isUndefined() && Body->isUndefined()) continue; + if (Sym->Body->MustBeInDynSym) + Body->MustBeInDynSym = true; Sym->Body = Body; } ObjectFiles.emplace_back(Obj); Index: ELF/Symbols.cpp =================================================================== --- ELF/Symbols.cpp +++ ELF/Symbols.cpp @@ -185,7 +185,7 @@ // and in DSOs, so that the symbols in the executable can interrupt // symbols in the DSO at runtime. if (isShared() != Other->isShared()) - if (isa>(isShared() ? Other : this)) + if (isa(isShared() ? Other : this)) MustBeInDynSym = Other->MustBeInDynSym = true; if (L != R)