aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/sys_netbsd_arm64.s
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2021-03-29 17:38:20 -0400
committerAustin Clements <austin@google.com>2021-04-01 00:51:26 +0000
commitec721d92bf35cd47543acf6792acd474fdd39446 (patch)
tree9a8c2a9df49cdfb2b9b6e0364c086ebfdfa0e962 /src/runtime/sys_netbsd_arm64.s
parent1f29e69bad3673aa4f9d1c4d1016170b9ced634a (diff)
downloadgo-ec721d92bf35cd47543acf6792acd474fdd39446.tar.gz
go-ec721d92bf35cd47543acf6792acd474fdd39446.zip
runtime: fix uses of ABIInternal PCs in assembly
The covers three kinds of uses: 1. Calls of closures from assembly. These are always ABIInternal calls without wrappers. I went through every indirect call in the runtime and I think mcall is the only case of assembly calling a Go closure in a way that's affected by ABIInternal. systemstack also calls a closure, but it takes no arguments. 2. Calls of Go functions that expect raw ABIInternal pointers. I also only found one of these: callbackasm1 -> cgocallback on Windows. These are trickier to find, though. 3. Finally, I found one case on NetBSD where new OS threads were directly calling the Go runtime entry-point from assembly via a PC, rather than going through a wrapper. This meant new threads may not have special registers set up. In this case, a change on all other OSes had already forced new thread entry to go through an ABI wrapper, so I just caught NetBSD up with that change. With this change, I'm able to run a "hello world" with GOEXPERIMENT=regabi,regabiargs. For #40724. Change-Id: I2a6d0e530c4fd4edf13484d923891c6160d683aa Reviewed-on: https://go-review.googlesource.com/c/go/+/305669 Trust: Austin Clements <austin@google.com> Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/runtime/sys_netbsd_arm64.s')
-rw-r--r--src/runtime/sys_netbsd_arm64.s4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/sys_netbsd_arm64.s b/src/runtime/sys_netbsd_arm64.s
index 4d9b05478f..1446a27f4c 100644
--- a/src/runtime/sys_netbsd_arm64.s
+++ b/src/runtime/sys_netbsd_arm64.s
@@ -76,6 +76,10 @@ nog:
MOVD $0, R0 // crash (not reached)
MOVD R0, (R8)
+TEXT ·netbsdMstart(SB),NOSPLIT|TOPFRAME,$0
+ CALL ·netbsdMstart0(SB)
+ RET // not reached
+
TEXT runtime·osyield(SB),NOSPLIT,$0
SVC $SYS_sched_yield
RET