1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

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

llvm-svn: 200490
This commit is contained in:
Timur Iskhodzhanov 2014-01-30 21:13:05 +00:00
parent fae4ff3453
commit 04f94cf108
3 changed files with 17 additions and 0 deletions

View File

@ -1153,6 +1153,10 @@ public:
return *Entry;
}
bool hasSymbolData(const MCSymbol &Symbol) const {
return SymbolMap.lookup(&Symbol) != 0;
}
MCSymbolData &getSymbolData(const MCSymbol &Symbol) const {
MCSymbolData *Entry = SymbolMap.lookup(&Symbol);
assert(Entry && "Missing symbol data!");

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();

View File

@ -0,0 +1,8 @@
// RUN: not llvm-mc -filetype=obj -triple i686-pc-win32 %s 2>%t
// RUN: FileCheck %s < %t
// CHECK: symbol 'bar' can not be undefined
.data
foo:
.secidx bar