From 8380de416bbb3550de902374b7626e569060a712 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 27 Oct 2016 17:36:39 -0400 Subject: 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 TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/runtime/sys_linux_amd64.s | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/runtime/sys_linux_amd64.s') diff --git a/src/runtime/sys_linux_amd64.s b/src/runtime/sys_linux_amd64.s index ee7b0ffb37..7f88e1db23 100644 --- a/src/runtime/sys_linux_amd64.s +++ b/src/runtime/sys_linux_amd64.s @@ -219,11 +219,16 @@ TEXT runtime·rt_sigaction(SB),NOSPLIT,$0-36 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 -- cgit v1.3