Make sure that stack is 16-byte aligned before calling a function,
as it is required by amd64 ABI. Add a comment for the places were the stack is accidentally properly aligned already. PR: amd64/162214 Submitted by: yamayan <yamayan kbh biglobe ne jp> MFC after: 1 week
This commit is contained in:
parent
953d552ca4
commit
d5bbfd2b4a
@ -54,6 +54,7 @@ ENTRY(setjmp)
|
||||
movq $1,%rdi /* SIG_BLOCK */
|
||||
movq $0,%rsi /* (sigset_t*)set */
|
||||
leaq 72(%rcx),%rdx /* 9,10; (sigset_t*)oset */
|
||||
/* stack is 16-byte aligned */
|
||||
call PIC_PLT(CNAME(_sigprocmask))
|
||||
popq %rdi
|
||||
movq %rdi,%rcx
|
||||
@ -81,7 +82,9 @@ ENTRY(__longjmp)
|
||||
movq $3,%rdi /* SIG_SETMASK */
|
||||
leaq 72(%rdx),%rsi /* (sigset_t*)set */
|
||||
movq $0,%rdx /* (sigset_t*)oset */
|
||||
subq $0x8,%rsp /* make the stack 16-byte aligned */
|
||||
call PIC_PLT(CNAME(_sigprocmask))
|
||||
addq $0x8,%rsp
|
||||
popq %rsi
|
||||
popq %rdi /* jmpbuf */
|
||||
movq %rdi,%rdx
|
||||
|
@ -62,6 +62,7 @@ ENTRY(sigsetjmp)
|
||||
movq $1,%rdi /* SIG_BLOCK */
|
||||
movq $0,%rsi /* (sigset_t*)set */
|
||||
leaq 72(%rcx),%rdx /* 9,10 (sigset_t*)oset */
|
||||
/* stack is 16-byte aligned */
|
||||
call PIC_PLT(CNAME(_sigprocmask))
|
||||
popq %rdi
|
||||
2: movq %rdi,%rcx
|
||||
@ -90,7 +91,9 @@ ENTRY(__siglongjmp)
|
||||
movq $3,%rdi /* SIG_SETMASK */
|
||||
leaq 72(%rdx),%rsi /* (sigset_t*)set */
|
||||
movq $0,%rdx /* (sigset_t*)oset */
|
||||
subq $0x8,%rsp /* make the stack 16-byte aligned */
|
||||
call PIC_PLT(CNAME(_sigprocmask))
|
||||
addq $0x8,%rsp
|
||||
popq %rsi
|
||||
popq %rdi /* jmpbuf */
|
||||
2: movq %rdi,%rdx
|
||||
|
Loading…
Reference in New Issue
Block a user