summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-08-08 23:12:22 +0000
committerLang Hames <lhames@gmail.com>2014-08-08 23:12:22 +0000
commit25d93099dda408e899f231dac0ba984884e84070 (patch)
tree3a1cfe4852e933225118bd36315cc4ec2fad9991 /llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
parent4c956fe12993d418dc49bc1eeb90229098039104 (diff)
downloadbcm5719-llvm-25d93099dda408e899f231dac0ba984884e84070.tar.gz
bcm5719-llvm-25d93099dda408e899f231dac0ba984884e84070.zip
[MCJIT] Simplify immediate decoding code in the RuntimeDyldMachO hierarchy.
Cleanup only: no functional change. This patch makes RuntimeDyldMachO targets directly responsible for decoding immediates, rather than letting them implement catch a callback from generic code. Since this is a very target specific operation, it makes sense to let the target-specific code drive it. llvm-svn: 215255
Diffstat (limited to 'llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
index bae2471054d..986daef8a90 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
@@ -27,8 +27,10 @@ using namespace llvm::object;
namespace llvm {
-int64_t RuntimeDyldMachO::decodeAddend(uint8_t *LocalAddress, unsigned NumBytes,
- MachO::RelocationInfoType) const {
+int64_t RuntimeDyldMachO::memcpyAddend(const RelocationEntry &RE) const {
+ const SectionEntry &Section = Sections[RE.SectionID];
+ uint8_t *LocalAddress = Section.Address + RE.Offset;
+ unsigned NumBytes = 1 << RE.Size;
int64_t Addend = 0;
memcpy(&Addend, LocalAddress, NumBytes);
return Addend;
OpenPOWER on IntegriCloud