From f5e5bc1a4281b22c9ca2c75431647638de515ba0 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Fri, 31 May 2019 16:38:56 -0400 Subject: runtime: mark all Go symbols called from assembly in other packages This marks all Go symbols called from assembly in other packages with "go:linkname" directives to ensure they get ABI wrappers. Now that we have this go:linkname convention, this also removes the abi0Syms definition in the runtime, which was used to give morestackc an ABI0 wrapper. Instead, we now just mark morestackc with a go:linkname directive. This was tested with buildall.bash in the default configuration, with -race, and with -gcflags=all=-d=ssa/intrinsics/off. Since I couldn't test cgo on non-Linux configurations, I manually grepped for runtime symbols in runtime/cgo. Updates #31230. Change-Id: I6c8aa56be2ca6802dfa2bf159e49c411b9071bf1 Reviewed-on: https://go-review.googlesource.com/c/go/+/179862 Run-TryBot: Austin Clements TryBot-Result: Gobot Gobot Reviewed-by: Michael Knyszek --- src/runtime/string.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/runtime/string.go') diff --git a/src/runtime/string.go b/src/runtime/string.go index 839e882cdc..d198f73756 100644 --- a/src/runtime/string.go +++ b/src/runtime/string.go @@ -310,6 +310,8 @@ func gobytes(p *byte, n int) (b []byte) { return } +// This is exported via linkname to assembly in syscall (for Plan9). +//go:linkname gostring func gostring(p *byte) string { l := findnull(p) if l == 0 { -- cgit v1.3-5-g9baa