diff options
author | Bryan C. Mills <bcmills@google.com> | 2016-10-27 17:36:39 -0400 |
---|---|---|
committer | Bryan Mills <bcmills@google.com> | 2016-11-01 17:37:43 +0000 |
commit | 8380de416bbb3550de902374b7626e569060a712 (patch) | |
tree | e22a92add24f5a3941b3c42f44e1692829cca660 /src/runtime/sys_linux_386.s | |
parent | b2c54afe1451f93e1fbbad257a151d8425cd308d (diff) | |
download | go-8380de416bbb3550de902374b7626e569060a712.tar.gz go-8380de416bbb3550de902374b7626e569060a712.zip |
runtime: align stack pointer in sigfwd
sigfwd calls an arbitrary C signal handler function. The System V ABI
for x86_64 (and the most recent revision of the ABI for i386) requires
the stack to be 16-byte aligned.
Fixes: #17641
Change-Id: I77f53d4a8c29c1b0fe8cfbcc8d5381c4e6f75a6b
Reviewed-on: https://go-review.googlesource.com/32107
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime/sys_linux_386.s')
-rw-r--r-- | src/runtime/sys_linux_386.s | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/runtime/sys_linux_386.s b/src/runtime/sys_linux_386.s index 86ca06fd2c..1d798c741e 100644 --- a/src/runtime/sys_linux_386.s +++ b/src/runtime/sys_linux_386.s @@ -212,14 +212,20 @@ TEXT runtime·rt_sigaction(SB),NOSPLIT,$0 RET TEXT runtime·sigfwd(SB),NOSPLIT,$12-16 - MOVL sig+4(FP), AX - MOVL AX, 0(SP) - MOVL info+8(FP), AX - MOVL AX, 4(SP) - MOVL ctx+12(FP), AX - MOVL AX, 8(SP) MOVL fn+0(FP), AX + MOVL sig+4(FP), BX + MOVL info+8(FP), CX + MOVL ctx+12(FP), DX + MOVL SP, SI + SUBL $32, SP + ANDL $-15, SP // align stack: handler might be a C function + MOVL BX, 0(SP) + MOVL CX, 4(SP) + MOVL DX, 8(SP) + MOVL SI, 12(SP) // save SI: handler might be a Go function CALL AX + MOVL 12(SP), AX + MOVL AX, SP RET TEXT runtime·sigtramp(SB),NOSPLIT,$12 |