From 077f03f4d878f3b62e4aa15cdbd7cabc9dd08a11 Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Tue, 18 May 2021 12:47:30 -0400 Subject: [PATCH] [dev.typeparams] runtime: use internal/abi.FuncPCABI0 for sigtramp PC on FreeBSD Same as CL 313230, for FreeBSD. sigtramp is the only one we need. Change-Id: Iefc00c1cb7e70b08a07c3bc3604b2114fd86563d Reviewed-on: https://go-review.googlesource.com/c/go/+/320912 Trust: Cherry Mui Run-TryBot: Cherry Mui TryBot-Result: Go Bot Reviewed-by: Than McIntosh --- src/runtime/os_freebsd2.go | 4 +++- src/runtime/os_freebsd_amd64.go | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/runtime/os_freebsd2.go b/src/runtime/os_freebsd2.go index fde6fbf1b14..53ba23b64cf 100644 --- a/src/runtime/os_freebsd2.go +++ b/src/runtime/os_freebsd2.go @@ -7,6 +7,8 @@ package runtime +import "internal/abi" + //go:nosplit //go:nowritebarrierrec func setsig(i uint32, fn uintptr) { @@ -14,7 +16,7 @@ func setsig(i uint32, fn uintptr) { sa.sa_flags = _SA_SIGINFO | _SA_ONSTACK | _SA_RESTART sa.sa_mask = sigset_all if fn == funcPC(sighandler) { - fn = funcPC(sigtramp) + fn = abi.FuncPCABI0(sigtramp) } sa.sa_handler = fn sigaction(i, &sa, nil) diff --git a/src/runtime/os_freebsd_amd64.go b/src/runtime/os_freebsd_amd64.go index dc0bb9ff96f..7ae80c25060 100644 --- a/src/runtime/os_freebsd_amd64.go +++ b/src/runtime/os_freebsd_amd64.go @@ -4,6 +4,8 @@ package runtime +import "internal/abi" + func cgoSigtramp() //go:nosplit @@ -14,9 +16,9 @@ func setsig(i uint32, fn uintptr) { sa.sa_mask = sigset_all if fn == funcPC(sighandler) { if iscgo { - fn = funcPC(cgoSigtramp) + fn = abi.FuncPCABI0(cgoSigtramp) } else { - fn = funcPC(sigtramp) + fn = abi.FuncPCABI0(sigtramp) } } sa.sa_handler = fn