mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
[RuntimeDyld] Fix handling of i386 PC-rel external relocations. This fixes
several more i386 MCJIT regression test failures. <rdar://problem/16889891> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208735 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8a8de72063
commit
9c29061391
@ -546,6 +546,17 @@ relocation_iterator RuntimeDyldMachO::processRelocationRef(
|
||||
Value.Addend = Addend;
|
||||
}
|
||||
}
|
||||
|
||||
// Addends for external, PC-rel relocations on i386 point back to the zero
|
||||
// offset. Calculate the final offset from the relocation target instead.
|
||||
// This allows us to use the same logic for both external and internal
|
||||
// relocations in resolveI386RelocationRef.
|
||||
if (Arch == Triple::x86 && IsPCRel) {
|
||||
uint64_t RelocAddr = 0;
|
||||
RelI->getAddress(RelocAddr);
|
||||
Value.Addend += RelocAddr + 4;
|
||||
}
|
||||
|
||||
} else {
|
||||
SectionRef Sec = MachO->getRelocationSection(RE);
|
||||
bool IsCode = false;
|
||||
|
Loading…
Reference in New Issue
Block a user