diff options
author | Eugene Leviant <eleviant@accesssoftek.com> | 2017-12-15 09:18:21 +0000 |
---|---|---|
committer | Eugene Leviant <eleviant@accesssoftek.com> | 2017-12-15 09:18:21 +0000 |
commit | 72044ef693b2feac283e28db0e6aa9b2dfc39a14 (patch) | |
tree | edbddcbda6c91ed09f8b6801d75fc241e2362b41 /lib/LTO/LTO.cpp | |
parent | 01cfc43fe473b6cac0e01795556324dbef4388fc (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.cpp | 5 |
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 |