From ee88852fc1e721a71d15bd477e3cc6df904b5f78 Mon Sep 17 00:00:00 2001 From: Joel Sing Date: Mon, 9 May 2016 02:13:03 +1000 Subject: [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 --- src/runtime/sys_openbsd_386.s | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/runtime/sys_openbsd_386.s b/src/runtime/sys_openbsd_386.s index 5cda7768ae..b9067871cd 100644 --- a/src/runtime/sys_openbsd_386.s +++ b/src/runtime/sys_openbsd_386.s @@ -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)); -- cgit v1.2.3-54-g00ecf