Fix PR18381 - print a minimal diagnostic rather than assert on unresolved .secidx target

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200490 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Timur Iskhodzhanov
2014-01-30 21:13:05 +00:00
parent 6420c11093
commit 4e54e6fe75
3 changed files with 17 additions and 0 deletions

View File

@ -636,6 +636,11 @@ void WinCOFFObjectWriter::RecordRelocation(const MCAssembler &Asm,
const MCSymbol &Symbol = Target.getSymA()->getSymbol();
const MCSymbol &A = Symbol.AliasedSymbol();
if (!Asm.hasSymbolData(A))
Asm.getContext().FatalError(
Fixup.getLoc(),
Twine("symbol '") + A.getName() + "' can not be undefined");
MCSymbolData &A_SD = Asm.getSymbolData(A);
MCSectionData const *SectionData = Fragment->getParent();