aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_dragonfly_amd64.s
diff options
context:
space:
mode:
authorBryan C. Mills <bcmills@google.com>2016-10-27 17:36:39 -0400
committerBryan Mills <bcmills@google.com>2016-11-01 17:37:43 +0000
commit8380de416bbb3550de902374b7626e569060a712 (patch)
treee22a92add24f5a3941b3c42f44e1692829cca660 /src/runtime/sys_dragonfly_amd64.s
parentb2c54afe1451f93e1fbbad257a151d8425cd308d (diff)
downloadgo-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_dragonfly_amd64.s')
-rw-r--r--src/runtime/sys_dragonfly_amd64.s11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/runtime/sys_dragonfly_amd64.s b/src/runtime/sys_dragonfly_amd64.s
index fd960e608a..88c7f9dd8a 100644
--- a/src/runtime/sys_dragonfly_amd64.s
+++ b/src/runtime/sys_dragonfly_amd64.s
@@ -188,11 +188,16 @@ TEXT runtime·sigaction(SB),NOSPLIT,$-8
RET
TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
- MOVL sig+8(FP), DI
+ MOVQ fn+0(FP), AX
+ MOVL sig+8(FP), DI
MOVQ info+16(FP), SI
- MOVQ ctx+24(FP), DX
- MOVQ fn+0(FP), AX
+ MOVQ ctx+24(FP), DX
+ PUSHQ BP
+ MOVQ SP, BP
+ ANDQ $~15, SP // alignment for x86_64 ABI
CALL AX
+ MOVQ BP, SP
+ POPQ BP
RET
TEXT runtime·sigtramp(SB),NOSPLIT,$24