1
0
mirror of https://github.com/golang/go synced 2024-11-17 14:14:56 -07:00

runtime: mark sigtramp as TOPFRAME on the rest of unix

This extends CL 402190 from Linux to the rest of the Unix OSes.

Marking sigtramp as TOPFRAME allows gentraceback to stop tracebacks at
the end of a signal handler, since there is not much beyond sigtramp.

Change-Id: I8b7f5d55d41889f59c0a79c65351b9b0b2d77717
Reviewed-on: https://go-review.googlesource.com/c/go/+/402934
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Austin Clements <austin@google.com>
Auto-Submit: Michael Pratt <mpratt@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Michael Pratt <mpratt@google.com>
This commit is contained in:
Michael Pratt 2022-04-28 12:58:32 -04:00 committed by Gopher Robot
parent c90a19a760
commit cb6fc99b32
18 changed files with 18 additions and 18 deletions

View File

@ -101,7 +101,7 @@ GLOBL runtime·sigtramp(SB), NOPTR, $24
// This function must not have any frame as we want to control how
// every registers are used.
// TODO(aix): Implement SetCgoTraceback handler.
TEXT sigtramp<>(SB),NOSPLIT|NOFRAME,$0
TEXT sigtramp<>(SB),NOSPLIT|NOFRAME|TOPFRAME,$0
MOVD LR, R0
MOVD R0, 16(R1)
// initialize essential registers (just in case)

View File

@ -214,7 +214,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
// This is the function registered during sigaction and is invoked when
// a signal is received. It just redirects to the Go function sigtrampgo.
// Called using C ABI.
TEXT runtime·sigtramp(SB),NOSPLIT,$0
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Transition from C ABI to Go ABI.
PUSH_REGS_HOST_TO_ABI0()

View File

@ -176,7 +176,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
BL (R11)
RET
TEXT runtime·sigtramp(SB),NOSPLIT,$176
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$176
// Save callee-save registers in the case of signal forwarding.
// Please refer to https://golang.org/issue/31827 .
SAVE_R19_TO_R28(8*4)

View File

@ -222,7 +222,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
RET
// Called using C ABI.
TEXT runtime·sigtramp(SB),NOSPLIT,$0
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Transition from C ABI to Go ABI.
PUSH_REGS_HOST_TO_ABI0()

View File

@ -253,7 +253,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$12-16
RET
// Called by OS using C ABI.
TEXT runtime·sigtramp(SB),NOSPLIT,$12
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$12
NOP SP // tell vet SP changed - stop checking offsets
MOVL 16(SP), BX // signo
MOVL BX, 0(SP)

View File

@ -224,7 +224,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
RET
// Called using C ABI.
TEXT runtime·sigtramp(SB),NOSPLIT,$0
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Transition from C ABI to Go ABI.
PUSH_REGS_HOST_TO_ABI0()

View File

@ -231,7 +231,7 @@ TEXT runtime·asmSigaction(SB),NOSPLIT|NOFRAME,$0
MOVW R0, ret+12(FP)
RET
TEXT runtime·sigtramp(SB),NOSPLIT,$0
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Reserve space for callee-save registers and arguments.
MOVM.DB.W [R4-R11], (R13)
SUB $16, R13

View File

@ -280,7 +280,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
RET
// func sigtramp()
TEXT runtime·sigtramp(SB),NOSPLIT,$176
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$176
// Save callee-save registers in the case of signal forwarding.
// Please refer to https://golang.org/issue/31827 .
SAVE_R19_TO_R28(8*4)

View File

@ -290,7 +290,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$12-16
RET
// Called by OS using C ABI.
TEXT runtime·sigtramp(SB),NOSPLIT,$28
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$28
NOP SP // tell vet SP changed - stop checking offsets
// Save callee-saved C registers, since the caller may be a C signal handler.
MOVL BX, bx-4(SP)

View File

@ -305,7 +305,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
RET
// Called using C ABI.
TEXT runtime·sigtramp(SB),NOSPLIT,$0
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Transition from C ABI to Go ABI.
PUSH_REGS_HOST_TO_ABI0()

View File

@ -288,7 +288,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-16
MOVW R4, R13
RET
TEXT runtime·sigtramp(SB),NOSPLIT,$0
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Reserve space for callee-save registers and arguments.
MOVM.DB.W [R4-R11], (R13)
SUB $16, R13

View File

@ -295,7 +295,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
BL (R11)
RET
TEXT runtime·sigtramp(SB),NOSPLIT,$176
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$176
// Save callee-save registers in the case of signal forwarding.
// Please refer to https://golang.org/issue/31827 .
SAVE_R19_TO_R28(8*4)

View File

@ -69,7 +69,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-16
RET
// Called by OS using C ABI.
TEXT runtime·sigtramp(SB),NOSPLIT,$28
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$28
NOP SP // tell vet SP changed - stop checking offsets
// Save callee-saved C registers, since the caller may be a C signal handler.
MOVL BX, bx-4(SP)

View File

@ -58,7 +58,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
RET
// Called using C ABI.
TEXT runtime·sigtramp(SB),NOSPLIT,$0
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Transition from C ABI to Go ABI.
PUSH_REGS_HOST_TO_ABI0()

View File

@ -61,7 +61,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-16
MOVW R9, R13
RET
TEXT runtime·sigtramp(SB),NOSPLIT,$0
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Reserve space for callee-save registers and arguments.
MOVM.DB.W [R4-R11], (R13)
SUB $16, R13

View File

@ -51,7 +51,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
BL (R11) // Alignment for ELF ABI?
RET
TEXT runtime·sigtramp(SB),NOSPLIT,$192
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$192
// Save callee-save registers in the case of signal forwarding.
// Please refer to https://golang.org/issue/31827 .
SAVE_R19_TO_R28(8*4)

View File

@ -237,7 +237,7 @@ TEXT runtime·sigfwd(SB),NOSPLIT,$0-32
CALL (R25)
RET
TEXT runtime·sigtramp(SB),NOSPLIT,$192
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$192
// initialize REGSB = PC&0xffffffff00000000
BGEZAL R0, 1(PC)
SRLV $32, R31, RSB

View File

@ -121,7 +121,7 @@ TEXT runtime·tstart_sysvicall(SB),NOSPLIT,$0
// Careful, this is called by __sighndlr, a libc function. We must preserve
// registers as per AMD 64 ABI.
TEXT runtime·sigtramp(SB),NOSPLIT,$0
TEXT runtime·sigtramp(SB),NOSPLIT|TOPFRAME,$0
// Note that we are executing on altsigstack here, so we have
// more stack available than NOSPLIT would have us believe.
// To defeat the linker, we make our own stack frame with