diff options
author | Lang Hames <lhames@gmail.com> | 2014-10-10 23:07:09 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2014-10-10 23:07:09 +0000 |
commit | 3d4340f8c810a5b8be956e9dff2caaadb3c3a79c (patch) | |
tree | 2675ae14a04f2d5ba1a28102865b28d21e42770e | |
parent | ad8b666624e17bfc89a684cf060d96c3b6905d92 (diff) | |
download | bcm5719-llvm-3d4340f8c810a5b8be956e9dff2caaadb3c3a79c.tar.gz bcm5719-llvm-3d4340f8c810a5b8be956e9dff2caaadb3c3a79c.zip |
[MCJIT] Replace memcpy with readBytesUnaligned in RuntimeDyldMachOI386.
This should fix the failures of the MachO_i386_DynNoPIC_relocations.s test case
on MIPS hosts.
llvm-svn: 219543
-rw-r--r-- | llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h b/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h index 3ff784d63e8..258b8476d42 100644 --- a/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h +++ b/llvm/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h @@ -142,8 +142,7 @@ private: RelI->getOffset(Offset); uint8_t *LocalAddress = Section.Address + Offset; unsigned NumBytes = 1 << Size; - int64_t Addend = 0; - memcpy(&Addend, LocalAddress, NumBytes); + uint64_t Addend = readBytesUnaligned(LocalAddress, NumBytes); ++RelI; MachO::any_relocation_info RE2 = @@ -202,8 +201,7 @@ private: RelI->getOffset(Offset); uint8_t *LocalAddress = Section.Address + Offset; unsigned NumBytes = 1 << Size; - int64_t Addend = 0; - memcpy(&Addend, LocalAddress, NumBytes); + int64_t Addend = readBytesUnaligned(LocalAddress, NumBytes); unsigned SymbolBaseAddr = MachO->getScatteredRelocationValue(RE); section_iterator TargetSI = getSectionByAddress(*MachO, SymbolBaseAddr); |