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_netbsd_amd64.s | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/runtime/sys_netbsd_amd64.s') diff --git a/src/runtime/sys_netbsd_amd64.s b/src/runtime/sys_netbsd_amd64.s index e0dd85f2aa..2c50adb123 100644 --- a/src/runtime/sys_netbsd_amd64.s +++ b/src/runtime/sys_netbsd_amd64.s @@ -238,11 +238,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,$32 -- cgit v1.3-5-g9baa