From 458b495075da02286d068f61b240ee9c8d4cd027 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Fri, 10 Oct 2014 23:07:09 +0000 Subject: [PATCH] [MCJIT] Replace memcpy with readBytesUnaligned in RuntimeDyldMachOI386. This should fix the failures of the MachO_i386_DynNoPIC_relocations.s test case on MIPS hosts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219543 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../RuntimeDyld/Targets/RuntimeDyldMachOI386.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h b/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h index 3ff784d63e8..258b8476d42 100644 --- a/lib/ExecutionEngine/RuntimeDyld/Targets/RuntimeDyldMachOI386.h +++ b/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); -- 2.34.1