diff options
Diffstat (limited to 'system/gcc/sanitation.patch')
-rw-r--r-- | system/gcc/sanitation.patch | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/system/gcc/sanitation.patch b/system/gcc/sanitation.patch index 7dcdb0b65..861f5d08e 100644 --- a/system/gcc/sanitation.patch +++ b/system/gcc/sanitation.patch @@ -71,18 +71,24 @@ // Doesn't set sa_restorer if the caller did not set it, so use with caution //(see below). int internal_sigaction_norestorer(int signum, const void *act, void *oldact) { -@@ -2173,11 +2170,11 @@ +@@ -2173,11 +2170,20 @@ *bp = ucontext->uc_mcontext.mc_frame[31]; # else ucontext_t *ucontext = (ucontext_t*)context; -- *pc = ucontext->uc_mcontext.regs->nip; -- *sp = ucontext->uc_mcontext.regs->gpr[PT_R1]; ++#ifdef __powerpc64__ + *pc = ucontext->uc_mcontext.regs->nip; + *sp = ucontext->uc_mcontext.regs->gpr[PT_R1]; ++#else + *pc = ucontext->uc_mcontext.gregs[PT_NIP]; + *sp = ucontext->uc_mcontext.gregs[PT_R1]; ++#endif // The powerpc{,64}-linux ABIs do not specify r31 as the frame // pointer, but GCC always uses r31 when we need a frame pointer. -- *bp = ucontext->uc_mcontext.regs->gpr[PT_R31]; ++#ifdef __powerpc64__ + *bp = ucontext->uc_mcontext.regs->gpr[PT_R31]; ++#else + *bp = ucontext->uc_mcontext.gregs[PT_R31]; ++#endif # endif #elif defined(__sparc__) #if defined(__arch64__) || defined(__sparcv9) |