mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-28 06:32:09 +00:00
MC/Mach-O: Error out instead of crashing on invalid scattered relocation expressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97983 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b93c72cda4
commit
0ce6bd55c3
@ -447,13 +447,22 @@ public:
|
||||
// See <reloc.h>.
|
||||
const MCSymbol *A = Target.getSymA();
|
||||
MCSymbolData *SD = SymbolMap.lookup(A);
|
||||
|
||||
if (!SD->getFragment())
|
||||
llvm_report_error("symbol '" + A->getName() +
|
||||
"' can not be undefined in a subtraction expression");
|
||||
|
||||
uint32_t Value = SD->getFragment()->getAddress() + SD->getOffset();
|
||||
uint32_t Value2 = 0;
|
||||
|
||||
if (const MCSymbol *B = Target.getSymB()) {
|
||||
Type = RIT_LocalDifference;
|
||||
|
||||
MCSymbolData *SD = SymbolMap.lookup(B);
|
||||
|
||||
if (!SD->getFragment())
|
||||
llvm_report_error("symbol '" + B->getName() +
|
||||
"' can not be undefined in a subtraction expression");
|
||||
|
||||
Type = RIT_LocalDifference;
|
||||
Value2 = SD->getFragment()->getAddress() + SD->getOffset();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user