diff options
author | Michael Munday <mike.munday@ibm.com> | 2019-03-28 12:51:30 -0400 |
---|---|---|
committer | Michael Munday <mike.munday@ibm.com> | 2019-04-15 13:17:28 +0000 |
commit | aafe257390cc9048e8b5df898fabd79a9e0d4c39 (patch) | |
tree | 2c0636b4b1ab59eb4b00a1f185515ce22ee2ff5a /src/runtime/asm_arm64.s | |
parent | 0bd101cecc5458a8463b8d672bf1745c3cbb7c02 (diff) | |
download | go-aafe257390cc9048e8b5df898fabd79a9e0d4c39.tar.gz go-aafe257390cc9048e8b5df898fabd79a9e0d4c39.zip |
cmd/link, runtime: mark goexit as the top of the call stack
This CL adds a new attribute, TOPFRAME, which can be used to mark
functions that should be treated as being at the top of the call
stack. The function `runtime.goexit` has been marked this way on
architectures that use a link register.
This will stop programs that use DWARF to unwind the call stack
from unwinding past `runtime.goexit` on architectures that use a
link register. For example, it eliminates "corrupt stack?"
warnings when generating a backtrace that hits `runtime.goexit`
in GDB on s390x.
Similar code should be added for non-link-register architectures
(i.e. amd64, 386). They mark the top of the call stack slightly
differently to link register architectures so I haven't added
that code (they need to mark "rip" as undefined).
Fixes #24385.
Change-Id: I15b4c69ac75b491daa0acf0d981cb80eb06488de
Reviewed-on: https://go-review.googlesource.com/c/go/+/169726
Run-TryBot: Michael Munday <mike.munday@ibm.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/runtime/asm_arm64.s')
-rw-r--r-- | src/runtime/asm_arm64.s | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/asm_arm64.s b/src/runtime/asm_arm64.s index f7cf0d3544..871dc95dea 100644 --- a/src/runtime/asm_arm64.s +++ b/src/runtime/asm_arm64.s @@ -1124,7 +1124,7 @@ TEXT runtime·return0(SB), NOSPLIT, $0 // The top-most function running on a goroutine // returns to goexit+PCQuantum. -TEXT runtime·goexit(SB),NOSPLIT|NOFRAME,$0-0 +TEXT runtime·goexit(SB),NOSPLIT|NOFRAME|TOPFRAME,$0-0 MOVD R0, R0 // NOP BL runtime·goexit1(SB) // does not return |