mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
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:
parent
6420c11093
commit
4e54e6fe75
@ -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!");
|
||||
|
@ -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();
|
||||
|
8
test/MC/COFF/secidx-diagnostic.s
Normal file
8
test/MC/COFF/secidx-diagnostic.s
Normal 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
|
Loading…
Reference in New Issue
Block a user