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