mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-02 08:42:48 +00:00
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
This commit is contained in:
parent
4be4b11f30
commit
a4d64816be
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=295186
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user