diff options
author | jhibbits <jhibbits@FreeBSD.org> | 2016-02-03 01:50:27 +0000 |
---|---|---|
committer | jhibbits <jhibbits@FreeBSD.org> | 2016-02-03 01:50:27 +0000 |
commit | 86be85e87ea583d6b89dc395f00ae6b6ba8ec606 (patch) | |
tree | 642f1a0a39b8666374c3bcbaa1bd7ef9891bacc2 /sys/powerpc | |
parent | d8a6a1cf148b47a295850717ae031f12d55b5741 (diff) | |
download | FreeBSD-src-86be85e87ea583d6b89dc395f00ae6b6ba8ec606.zip FreeBSD-src-86be85e87ea583d6b89dc395f00ae6b6ba8ec606.tar.gz |
Align signal stack pointer to 16 bytes.
The stack must be aligned to 16 bytes at all times. Clang 3.8 is especially
adamant about this, and causes strange behavior and segmentation faults if it is
not the case.
PR: kern/206810
Diffstat (limited to 'sys/powerpc')
-rw-r--r-- | sys/powerpc/powerpc/exec_machdep.c | 6 | ||||
-rw-r--r-- | sys/powerpc/powerpc/sigcode32.S | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/sys/powerpc/powerpc/exec_machdep.c b/sys/powerpc/powerpc/exec_machdep.c index d8238a1..4e56429 100644 --- a/sys/powerpc/powerpc/exec_machdep.c +++ b/sys/powerpc/powerpc/exec_machdep.c @@ -219,10 +219,10 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) */ if ((td->td_pflags & TDP_ALTSTACK) != 0 && !oonstack && SIGISMEMBER(psp->ps_sigonstack, sig)) { - usfp = (void *)((uintptr_t)td->td_sigstk.ss_sp + - td->td_sigstk.ss_size - rndfsize); + usfp = (void *)(((uintptr_t)td->td_sigstk.ss_sp + + td->td_sigstk.ss_size - rndfsize) & ~0xFul); } else { - usfp = (void *)(tf->fixreg[1] - rndfsize); + usfp = (void *)((tf->fixreg[1] - rndfsize) & ~0xFul); } /* diff --git a/sys/powerpc/powerpc/sigcode32.S b/sys/powerpc/powerpc/sigcode32.S index 0236182..cd4c3cf 100644 --- a/sys/powerpc/powerpc/sigcode32.S +++ b/sys/powerpc/powerpc/sigcode32.S @@ -45,9 +45,9 @@ */ .globl CNAME(sigcode32),CNAME(szsigcode32) CNAME(sigcode32): - addi 1,1,-20 /* reserved space for callee */ + addi 1,1,-32 /* reserved space for callee */ blrl - addi 3,1,20+SF_UC /* restore sp, and get &frame->sf_uc */ + addi 3,1,32+SF_UC /* restore sp, and get &frame->sf_uc */ li 0,SYS_sigreturn sc /* sigreturn(scp) */ li 0,SYS_exit |