From 298975c634758ee464dc0629402107bfc33c4b41 Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Mon, 5 Apr 2021 19:13:34 +0000 Subject: runtime: use funcID to identify abort in isAbortPC This change eliminates the use of funcPC to determine if an PC is in abort. Using funcPC for this purpose is problematic when using plugins because symbols no longer have unique PCs. funcPC also grabs the wrapper for runtime.abort which isn't what we want for the new register ABI, so rather than mark runtime.abort as ABIInternal, use funcID. For #40724. Change-Id: I2730e99fe6f326d22d64a10384828b94f04d101a Reviewed-on: https://go-review.googlesource.com/c/go/+/307391 Trust: Michael Knyszek Run-TryBot: Michael Knyszek TryBot-Result: Go Bot Reviewed-by: Cherry Zhang Reviewed-by: Austin Clements --- src/runtime/panic.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/runtime/panic.go') diff --git a/src/runtime/panic.go b/src/runtime/panic.go index bbf3ea473a..d33441a0d8 100644 --- a/src/runtime/panic.go +++ b/src/runtime/panic.go @@ -1484,5 +1484,9 @@ func shouldPushSigpanic(gp *g, pc, lr uintptr) bool { // //go:nosplit func isAbortPC(pc uintptr) bool { - return pc == funcPC(abort) || ((GOARCH == "arm" || GOARCH == "arm64") && pc == funcPC(abort)+sys.PCQuantum) + f := findfunc(pc) + if !f.valid() { + return false + } + return f.funcID == funcID_abort } -- cgit v1.3-6-g1900