[release-branch.go1.4] runtime: stop using sigreturn on openbsd/386

In future releases of OpenBSD, the sigreturn syscall will no longer
exist. As such, stop using sigreturn on openbsd/386 and just return
from the signal trampoline.

This is a backport of https://golang.org/cl/23024 to the Go 1.4 branch.

Updates #20672

Change-Id: Ia1caf9427c51a6871f51dbff06720f3158e38c68
Reviewed-on: https://go-review.googlesource.com/66071
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Joel Sing 2016-05-09 02:13:03 +10:00
parent a212494fc1
commit ee88852fc1
1 changed files with 1 additions and 10 deletions

View File

@ -186,7 +186,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44
MOVL BX, 0(SP)
MOVL $runtime·badsignal(SB), AX
CALL AX
JMP sigtramp_ret
RET
// save g
MOVL DI, 20(SP)
@ -211,15 +211,6 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$44
get_tls(CX)
MOVL 20(SP), BX
MOVL BX, g(CX)
sigtramp_ret:
// call sigreturn
MOVL context+8(FP), AX
MOVL $0, 0(SP) // syscall gap
MOVL AX, 4(SP) // arg 1 - sigcontext
MOVL $103, AX // sys_sigreturn
INT $0x80
MOVL $0xf1, 0xf1 // crash
RET
// int32 tfork(void *param, uintptr psize, M *mp, G *gp, void (*fn)(void));