mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
[MCJIT] Take the relocation addend into account when applying ARM MachO VANILLA
and BR24 relocations. <rdar://problem/18296496> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217605 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -101,12 +101,13 @@ public:
|
||||
default:
|
||||
llvm_unreachable("Invalid relocation type!");
|
||||
case MachO::ARM_RELOC_VANILLA:
|
||||
writeBytesUnaligned(Value, LocalAddress, 1 << RE.Size);
|
||||
writeBytesUnaligned(Value + RE.Addend, LocalAddress, 1 << RE.Size);
|
||||
break;
|
||||
case MachO::ARM_RELOC_BR24: {
|
||||
// Mask the value into the target address. We know instructions are
|
||||
// 32-bit aligned, so we can do it all at once.
|
||||
uint32_t *p = (uint32_t *)LocalAddress;
|
||||
Value += RE.Addend;
|
||||
// The low two bits of the value are not encoded.
|
||||
Value >>= 2;
|
||||
// Mask the value to 24 bits.
|
||||
|
Reference in New Issue
Block a user