1
0
mirror of https://github.com/golang/go synced 2024-11-17 11:44:51 -07:00
go/misc/cgo
Russ Cox 01f05d8ff1 runtime: unify asmcgocall and systemstack traceback setup
Both asmcgocall and systemstack need to save the calling Go code's
context for use by traceback, but they do it differently.
Systemstack's appraoch is better, because it doesn't require a
special case in traceback.
So make them both use that.

While we are here, the fake mstart caller in systemstack is
no longer needed and can be removed.
(traceback knows to stop in systemstack because of the writes to SP.)

Also remove the fake mstarts in sys_windows_*.s.

And while we are there, fix the control flow guard code in sys_windows_arm.s.
The current code is using pointers to a stack frame that technically is gone
once we hit the RET instruction. Clearly it's working OK, but better not to depend
on data below SP being preserved, even for just a few instructions.
Store the value we need in other registers instead.
(This code is only used for pushing a sigpanic call, which does not
actually return to the site of the fault and therefore doesn't need to
preserve any of the registers.)

This CL is part of a stack adding windows/arm64
support (#36439), intended to land in the Go 1.17 cycle.
This CL is, however, not windows/arm64-specific.
It is cleanup meant to make the port (and future ports) easier.

Change-Id: Id1e3ef5e54f7ad786e4b87043f2626eba7c3bbd9
Reviewed-on: https://go-review.googlesource.com/c/go/+/288799
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
2021-02-19 00:02:06 +00:00
..
errors cmd/go, cmd/cgo: don't let bogus symbol set cgo_ldflag 2020-11-12 20:58:06 +00:00
fortran
gmp
life
nocgo
stdio
test runtime: unify asmcgocall and systemstack traceback setup 2021-02-19 00:02:06 +00:00
testasan
testcarchive misc/cgo/testcarchive: remove special flags for Darwin/ARM 2020-12-30 22:39:59 +00:00
testcshared cmd/link: avoid exporting all symbols on windows buildmode=pie 2020-11-02 00:46:44 +00:00
testgodefs cmd/cgo: don't translate bitfields into Go fields 2020-09-16 03:02:13 +00:00
testplugin cmd/compile: mark plugin-exported types as used in interface 2020-11-13 22:01:37 +00:00
testsanitizers cmd/compile, runtime: use __msan_memmove for moving data, split msanread to fields 2020-12-03 15:40:11 +00:00
testshared cmd/link: don't decode type symbol in shared library in deadcode 2021-02-02 16:00:58 +00:00
testsigfwd
testso all: add GOOS=ios 2020-09-23 18:12:59 +00:00
testsovar all: add GOOS=ios 2020-09-23 18:12:59 +00:00
testtls