diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2014-10-24 13:40:02 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2014-10-24 13:40:02 +0000 |
commit | d3779269ca12e2c84a72e6ad9b2d00077f7f3ac5 (patch) | |
tree | 74a3d2cf4167c18ebcdeefbd1477194fdcfc8bb7 /winsup/cygwin/gendef | |
parent | 63a2c2c20404c6112c92e2b67445099732a7dad9 (diff) | |
download | cygnal-d3779269ca12e2c84a72e6ad9b2d00077f7f3ac5.tar.gz cygnal-d3779269ca12e2c84a72e6ad9b2d00077f7f3ac5.tar.bz2 cygnal-d3779269ca12e2c84a72e6ad9b2d00077f7f3ac5.zip |
* gendef (sigdelayed): 64 bit only: Push CPU flags before aligning
stack to avoid changing flag values.
Diffstat (limited to 'winsup/cygwin/gendef')
-rwxr-xr-x | winsup/cygwin/gendef | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef index b3914eb7b..6dcb94eae 100755 --- a/winsup/cygwin/gendef +++ b/winsup/cygwin/gendef @@ -187,11 +187,14 @@ _sigbe: # return here after cygwin syscall .global sigdelayed .seh_proc sigdelayed sigdelayed: + .seh_pushreg %rbp pushq %r10 # used for return address injection .seh_pushreg %rbp pushq %rbp .seh_pushreg %rbp movq %rsp,%rbp + .seh_pushreg %rax # fake, there's no .seh_pushreg for the flags + pushf # stack is aligned or unaligned on entry! # make sure it is aligned from here on # We could be called from an interrupted thread which doesn't know @@ -224,9 +227,8 @@ sigdelayed: .seh_pushreg %rbx pushq %rax .seh_pushreg %rax - pushf - subq \$0x130,%rsp - .seh_stackalloc 0x130 + subq \$0x128,%rsp + .seh_stackalloc 0x128 fnstcw 0x120(%rsp) movdqa %xmm15,0x110(%rsp) movdqa %xmm14,0x100(%rsp) @@ -288,8 +290,7 @@ sigdelayed: movdqa 0x110(%rsp),%xmm15 fninit fldcw 0x120(%rsp) - addq \$0x130,%rsp - popf + addq \$0x128,%rsp popq %rax popq %rbx popq %rcx @@ -304,6 +305,8 @@ sigdelayed: popq %r14 popq %r15 movq %rbp,%rsp + subq \$8, %rsp + popf popq %rbp xchgq %r10,(%rsp) ret |