summaryrefslogtreecommitdiff
path: root/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorEugene Leviant <eleviant@accesssoftek.com>2017-12-15 09:18:21 +0000
committerEugene Leviant <eleviant@accesssoftek.com>2017-12-15 09:18:21 +0000
commit72044ef693b2feac283e28db0e6aa9b2dfc39a14 (patch)
treeedbddcbda6c91ed09f8b6801d75fc241e2362b41 /lib/LTO/LTO.cpp
parent01cfc43fe473b6cac0e01795556324dbef4388fc (diff)
[LLVMgold] Don't set undefined symbol as prevailing
Differential revision: https://reviews.llvm.org/D41113 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320794 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/LTO/LTO.cpp')
-rw-r--r--lib/LTO/LTO.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/LTO/LTO.cpp b/lib/LTO/LTO.cpp
index 9c737795b5a..d6b50f551d9 100644
--- a/lib/LTO/LTO.cpp
+++ b/lib/LTO/LTO.cpp
@@ -416,8 +416,11 @@ void LTO::addModuleToGlobalRes(ArrayRef<InputFile::Symbol> Syms,
auto &GlobalRes = GlobalResolutions[Sym.getName()];
GlobalRes.UnnamedAddr &= Sym.isUnnamedAddr();
- if (Res.Prevailing)
+ if (Res.Prevailing) {
+ assert((GlobalRes.IRName.empty() || !Sym.getIRName().empty()) &&
+ "Overriding existing resolution with undefined asm symbol");
GlobalRes.IRName = Sym.getIRName();
+ }
// Set the partition to external if we know it is re-defined by the linker
// with -defsym or -wrap options, used elsewhere, e.g. it is visible to a