diff options
author | Austin Clements <austin@google.com> | 2019-05-31 16:38:56 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2019-06-06 19:44:12 +0000 |
commit | f5e5bc1a4281b22c9ca2c75431647638de515ba0 (patch) | |
tree | 72e401c8b96177f5eef8d30a676e0779e15b9eab /src/runtime/signal_unix.go | |
parent | dde7c770ef44d45b8a9f98bf0f46556f18df2f6e (diff) | |
download | go-f5e5bc1a4281b22c9ca2c75431647638de515ba0.tar.gz go-f5e5bc1a4281b22c9ca2c75431647638de515ba0.zip |
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 <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Diffstat (limited to 'src/runtime/signal_unix.go')
-rw-r--r-- | src/runtime/signal_unix.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/runtime/signal_unix.go b/src/runtime/signal_unix.go index f34008ff5f..ad51dc1800 100644 --- a/src/runtime/signal_unix.go +++ b/src/runtime/signal_unix.go @@ -369,6 +369,9 @@ func sigtrampgo(sig uint32, info *siginfo, ctx unsafe.Pointer) { // // The signal handler must not inject a call to sigpanic if // getg().throwsplit, since sigpanic may need to grow the stack. +// +// This is exported via linkname to assembly in runtime/cgo. +//go:linkname sigpanic func sigpanic() { g := getg() if !canpanic(g) { @@ -843,7 +846,11 @@ func signalstack(s *stack) { } // setsigsegv is used on darwin/arm{,64} to fake a segmentation fault. +// +// This is exported via linkname to assembly in runtime/cgo. +// //go:nosplit +//go:linkname setsigsegv func setsigsegv(pc uintptr) { g := getg() g.sig = _SIGSEGV |