mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-10 04:33:40 +00:00
MC/Mach-O: Fix a crash on invalid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103525 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6865f29fe7
commit
ef4591ef79
@ -584,7 +584,7 @@ public:
|
|||||||
// Add the local offset, if needed.
|
// Add the local offset, if needed.
|
||||||
if (Base != &SD)
|
if (Base != &SD)
|
||||||
Value += Layout.getSymbolAddress(&SD) - Layout.getSymbolAddress(Base);
|
Value += Layout.getSymbolAddress(&SD) - Layout.getSymbolAddress(Base);
|
||||||
} else {
|
} else if (Symbol->isInSection()) {
|
||||||
// The index is the section ordinal (1-based).
|
// The index is the section ordinal (1-based).
|
||||||
Index = SD.getFragment()->getParent()->getOrdinal() + 1;
|
Index = SD.getFragment()->getParent()->getOrdinal() + 1;
|
||||||
IsExtern = 0;
|
IsExtern = 0;
|
||||||
@ -592,6 +592,9 @@ public:
|
|||||||
|
|
||||||
if (IsPCRel)
|
if (IsPCRel)
|
||||||
Value -= Address + (1 << Log2Size);
|
Value -= Address + (1 << Log2Size);
|
||||||
|
} else {
|
||||||
|
report_fatal_error("unsupported relocation of undefined symbol '" +
|
||||||
|
Symbol->getName() + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
MCSymbolRefExpr::VariantKind Modifier = Target.getSymA()->getKind();
|
MCSymbolRefExpr::VariantKind Modifier = Target.getSymA()->getKind();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user