summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/ELF/Arch/PPC64.cpp3
-rw-r--r--lld/test/ELF/fill-trap-ppc.s7
2 files changed, 6 insertions, 4 deletions
diff --git a/lld/ELF/Arch/PPC64.cpp b/lld/ELF/Arch/PPC64.cpp
index 0da898dc208..8c03379f172 100644
--- a/lld/ELF/Arch/PPC64.cpp
+++ b/lld/ELF/Arch/PPC64.cpp
@@ -94,7 +94,8 @@ PPC64::PPC64() {
// use 0x10000000 as the starting address.
DefaultImageBase = 0x10000000;
- TrapInstr = 0x7fe00008;
+ TrapInstr =
+ (Config->IsLE == sys::IsLittleEndianHost) ? 0x7fe00008 : 0x0800e07f;
}
static uint32_t getEFlags(InputFile *File) {
diff --git a/lld/test/ELF/fill-trap-ppc.s b/lld/test/ELF/fill-trap-ppc.s
index f885f732302..da7d7cb320b 100644
--- a/lld/test/ELF/fill-trap-ppc.s
+++ b/lld/test/ELF/fill-trap-ppc.s
@@ -3,12 +3,12 @@
# RUN: llvm-mc -filetype=obj -triple=powerpc64le-linux %s -o %t.o
# RUN: ld.lld %t.o -o %t.ppc64le
# RUN: llvm-readobj -program-headers %t.ppc64le | FileCheck %s
-# RUN: od -Ax -t x4 -N16 -j0x10ff0 %t.ppc64le | FileCheck %s -check-prefix=FILL
+# RUN: od -Ax -t x1 -N16 -j0x10ff0 %t.ppc64le | FileCheck %s -check-prefix=LE
# RUN: llvm-mc -filetype=obj -triple=powerpc64-linux %s -o %t.o
# RUN: ld.lld %t.o -o %t.ppc64
# RUN: llvm-readobj -program-headers %t.ppc64 | FileCheck %s
-# RUN: od -Ax -t x4 -N16 -j0x10ff0 %t.ppc64 | FileCheck %s -check-prefix=FILL
+# RUN: od -Ax -t x1 -N16 -j0x10ff0 %t.ppc64 | FileCheck %s -check-prefix=BE
# CHECK: ProgramHeader {
# CHECK: Type: PT_LOAD
@@ -23,7 +23,8 @@
# CHECK-NEXT: ]
## Check that executable page is filled with traps at its end.
-# FILL: 010ff0 7fe00008 7fe00008 7fe00008 7fe00008
+# LE: 010ff0 08 00 e0 7f 08 00 e0 7f 08 00 e0 7f 08 00 e0 7f
+# BE: 010ff0 7f e0 00 08 7f e0 00 08 7f e0 00 08 7f e0 00 08
.globl _start
_start:
OpenPOWER on IntegriCloud