1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

[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
This commit is contained in:
Lang Hames 2014-10-10 23:07:09 +00:00
parent e2b7624499
commit b3aaa2726e

View File

@ -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);