diff options
author | Lang Hames <lhames@gmail.com> | 2014-09-11 17:27:01 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2014-09-11 17:27:01 +0000 |
commit | 4669cd08a75d1969a1b8b3deb7890b8fc0c00303 (patch) | |
tree | a1b11f71188bc128d8b25b6bedc00604ec226990 /llvm/lib | |
parent | eb7c1a6e50a6790cf498dc44ccb63ba1dc7447e2 (diff) | |
download | bcm5719-llvm-4669cd08a75d1969a1b8b3deb7890b8fc0c00303.tar.gz bcm5719-llvm-4669cd08a75d1969a1b8b3deb7890b8fc0c00303.zip |
[MCJIT] Take the relocation addend into account when applying ARM MachO VANILLA
and BR24 relocations.
<rdar://problem/18296496>
llvm-svn: 217605
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h b/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h index e29b8dc5091..dc8acfef5b7 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOARM.h @@ -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. |