summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-05-23 18:35:44 +0000
committerLang Hames <lhames@gmail.com>2014-05-23 18:35:44 +0000
commitbb75e24528a4bdb3030787640e4d5adb7cdfc476 (patch)
tree9e95b0b1571f83c99d4858b29dbdd3d06deb55fe /lib/ExecutionEngine/RuntimeDyld
parentbd62a7ad6c6840f893ed3987c8b2536a00be1224 (diff)
downloadllvm-bb75e24528a4bdb3030787640e4d5adb7cdfc476.tar.gz
llvm-bb75e24528a4bdb3030787640e4d5adb7cdfc476.tar.bz2
llvm-bb75e24528a4bdb3030787640e4d5adb7cdfc476.tar.xz
[RuntimeDyld] Remove relocation bounds check introduced in r208375 (MachO only).
We do all of our address arithmetic in 64-bit, and operations involving logically negative 32-bit offsets (actually represented as unsigned 64 bit ints) often overflow into higher bits. The overflow check could be preserved by casting to uint32 at the callsite for applyRelocationValue, but this would eliminate the value of the check. The right way to handle overflow in relocations is to make relocation processing target specific, and compute the values for RelocationEntry objects in the appropriate types (32-bit for 32-bit targets, 64-bit for 64-bit targets). This is coming as part of the cleanup I'm working on. This fixes another i386 regression test. <rdar://problem/16889891> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209536 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
index 6911f2f07a..08573eed5c 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h
@@ -28,16 +28,13 @@ class RuntimeDyldMachO : public RuntimeDyldImpl {
private:
/// Write the least significant 'Size' bytes in 'Value' out at the address
- /// pointed to by Addr. Check for overflow.
+ /// pointed to by Addr.
bool applyRelocationValue(uint8_t *Addr, uint64_t Value, unsigned Size) {
for (unsigned i = 0; i < Size; ++i) {
*Addr++ = (uint8_t)Value;
Value >>= 8;
}
- if (Value) // Catch overflow
- return Error("Relocation out of range.");
-
return false;
}