From: Ian Lance Taylor Date: Thu, 28 Jan 2016 06:00:59 +0000 (-0800) Subject: runtime: align stack in sigfwd for darwin/386 X-Git-Tag: go1.6rc2~3^2~11 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2d916bec968212c69dcff1da4c85943c529a11b5;p=gostls13.git runtime: align stack in sigfwd for darwin/386 We might be forwarding to a C signal handler. C code expects the stack to be aligned. Should fix darwin/386 build: the testcarchive tests were hanging as the program got an endless series of SIGSEGV signals. Change-Id: Ia02485d3736a3c40e12259f02d25f842cf8e4d29 Reviewed-on: https://go-review.googlesource.com/19025 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: David Crawshaw Reviewed-by: Brad Fitzpatrick --- diff --git a/src/runtime/sys_darwin_386.s b/src/runtime/sys_darwin_386.s index c516ef2da8..ad3dca444a 100644 --- a/src/runtime/sys_darwin_386.s +++ b/src/runtime/sys_darwin_386.s @@ -242,15 +242,21 @@ TEXT runtime·sigaction(SB),NOSPLIT,$0 MOVL $0xf1, 0xf1 // crash 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) +TEXT runtime·sigfwd(SB),NOSPLIT,$0-16 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 // align stack; handler might be C code + ANDL $~15, SP + MOVL BX, 0(SP) + MOVL CX, 4(SP) + MOVL DX, 8(SP) + MOVL SI, 12(SP) CALL AX + MOVL 12(SP), AX + MOVL AX, SP RET TEXT runtime·sigreturn(SB),NOSPLIT,$12-8