summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/LTO/LTO.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index f495774b033..0323bb83858 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -337,6 +337,8 @@ Error LTO::addRegularLTO(std::unique_ptr<InputFile> Input,
addSymbolToGlobalRes(Obj.get(), Used, Sym, Res, 0);
GlobalValue *GV = Obj->getSymbolGV(Sym.I->getRawDataRefImpl());
+ if (Sym.getFlags() & object::BasicSymbolRef::SF_Undefined)
+ continue;
if (Res.Prevailing && GV) {
Keep.push_back(GV);
switch (GV->getLinkage()) {
OpenPOWER on IntegriCloud