mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
[mips64] Emit correct addend for some PC-relative relocations
So far, LLVM has not emitted correct addend for N64 and N32 ABI. This patch fixes that. It also removes fixup from MCJIT for R_MIPS_PC16 relocation. Patch by Vladimir Radosavljevic. Differential Revision: http://reviews.llvm.org/D10565 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240404 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -630,7 +630,7 @@ RuntimeDyldELF::evaluateMIPS64Relocation(const SectionEntry &Section,
|
||||
}
|
||||
case ELF::R_MIPS_PC16: {
|
||||
uint64_t FinalAddress = (Section.LoadAddress + Offset);
|
||||
return ((Value + Addend - FinalAddress - 4) >> 2) & 0xffff;
|
||||
return ((Value + Addend - FinalAddress) >> 2) & 0xffff;
|
||||
}
|
||||
case ELF::R_MIPS_PC32: {
|
||||
uint64_t FinalAddress = (Section.LoadAddress + Offset);
|
||||
|
Reference in New Issue
Block a user