summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorDaniel Sanders <daniel.sanders@imgtec.com>2014-11-01 15:52:31 +0000
committerDaniel Sanders <daniel.sanders@imgtec.com>2014-11-01 15:52:31 +0000
commit523b1718d4bf8195cc2a23b9e4bee3a279e76cde (patch)
tree39f6e95ccc1033f5e497d522c3d9d89b09fef829 /llvm/lib/ExecutionEngine
parent792e3cae172096610131ad11a914a8b83432798f (diff)
downloadbcm5719-llvm-523b1718d4bf8195cc2a23b9e4bee3a279e76cde.tar.gz
bcm5719-llvm-523b1718d4bf8195cc2a23b9e4bee3a279e76cde.zip
[JIT] Fix some more missing endian conversions in RuntimeDyld
Summary: This fixes MachO_i386_eh_frame.s on a big-endian Mips host. Reviewers: lhames Reviewed By: lhames Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6019 llvm-svn: 221047
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
index ddd828244a5..d3d6f5d2546 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp
@@ -216,17 +216,18 @@ unsigned char *RuntimeDyldMachOCRTPBase<Impl>::processFDE(unsigned char *P,
DEBUG(dbgs() << "Processing FDE: Delta for text: " << DeltaForText
<< ", Delta for EH: " << DeltaForEH << "\n");
- uint32_t Length = *((uint32_t *)P);
+ uint32_t Length = readBytesUnaligned(P, 4);
P += 4;
unsigned char *Ret = P + Length;
- uint32_t Offset = *((uint32_t *)P);
+ uint32_t Offset = readBytesUnaligned(P, 4);
if (Offset == 0) // is a CIE
return Ret;
P += 4;
- TargetPtrT FDELocation = *((TargetPtrT*)P);
+ TargetPtrT FDELocation = readBytesUnaligned(P, sizeof(TargetPtrT));
TargetPtrT NewLocation = FDELocation - DeltaForText;
- *((TargetPtrT*)P) = NewLocation;
+ writeBytesUnaligned(NewLocation, P, sizeof(TargetPtrT));
+
P += sizeof(TargetPtrT);
// Skip the FDE address range
@@ -235,9 +236,9 @@ unsigned char *RuntimeDyldMachOCRTPBase<Impl>::processFDE(unsigned char *P,
uint8_t Augmentationsize = *P;
P += 1;
if (Augmentationsize != 0) {
- TargetPtrT LSDA = *((TargetPtrT *)P);
+ TargetPtrT LSDA = readBytesUnaligned(P, sizeof(TargetPtrT));
TargetPtrT NewLSDA = LSDA - DeltaForEH;
- *((TargetPtrT *)P) = NewLSDA;
+ writeBytesUnaligned(NewLSDA, P, sizeof(TargetPtrT));
}
return Ret;
OpenPOWER on IntegriCloud