Commit 2d916bec authored by Ian Lance Taylor's avatar Ian Lance Taylor

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 <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent e9709666
...@@ -242,15 +242,21 @@ TEXT runtime·sigaction(SB),NOSPLIT,$0 ...@@ -242,15 +242,21 @@ TEXT runtime·sigaction(SB),NOSPLIT,$0
MOVL $0xf1, 0xf1 // crash MOVL $0xf1, 0xf1 // crash
RET RET
TEXT runtime·sigfwd(SB),NOSPLIT,$12-16 TEXT runtime·sigfwd(SB),NOSPLIT,$0-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 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 CALL AX
MOVL 12(SP), AX
MOVL AX, SP
RET RET
TEXT runtime·sigreturn(SB),NOSPLIT,$12-8 TEXT runtime·sigreturn(SB),NOSPLIT,$12-8
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment