]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: mark sigtramp as TOPFRAME on the rest of unix
authorMichael Pratt <mpratt@google.com>
Thu, 28 Apr 2022 16:58:32 +0000 (12:58 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 28 Apr 2022 23:16:44 +0000 (23:16 +0000)
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>

18 files changed:
src/runtime/sys_aix_ppc64.s
src/runtime/sys_darwin_amd64.s
src/runtime/sys_darwin_arm64.s
src/runtime/sys_dragonfly_amd64.s
src/runtime/sys_freebsd_386.s
src/runtime/sys_freebsd_amd64.s
src/runtime/sys_freebsd_arm.s
src/runtime/sys_freebsd_arm64.s
src/runtime/sys_netbsd_386.s
src/runtime/sys_netbsd_amd64.s
src/runtime/sys_netbsd_arm.s
src/runtime/sys_netbsd_arm64.s
src/runtime/sys_openbsd_386.s
src/runtime/sys_openbsd_amd64.s
src/runtime/sys_openbsd_arm.s
src/runtime/sys_openbsd_arm64.s
src/runtime/sys_openbsd_mips64.s
src/runtime/sys_solaris_amd64.s

index 217ebb8878eba664ea2411268882458c023ee13e..772f357ca93619d56cbc1ec021636830ccc0963b 100644 (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)
index 8e75a38bd2f791e6635bcf9fe1b2c294844a2995..ba81fcc35c4424b8ec3d6c07b30a6be8e0200817 100644 (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()
 
index dc7c9bffa8351395d1acd6a810691163be35eb73..bf0dc9d8ccb6ce7ba5f3c4d73bcf04935e188245 100644 (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)
index 48b04ff9797364531e5101b5f46bcb1434f66d04..602d5e9b76b4512dce832e2deb74fccae2545e54 100644 (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()
 
index aceb6fe1bf992d9292be859e00d3339b7bcae515..9e5210b0db71ce17ca469465f436b290d4bd0b0b 100644 (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)
index 159f5c66ab99f254711b0577c59180e5f3cc8fdd..94341f6d4e456ba4bd9f49b076a1d470b6e53ded 100644 (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()
 
index 88ab0fc795d84d24a57feaf8b6632637897b3eb7..cbee34d13be7f74770e40024b306b6c29c167d8f 100644 (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
index a4f12eb3b923cda8be5bab42d791a0369f49b027..5dcdf375ab5c63afa96f3ad10741cbdafa5a6174 100644 (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)
index b7d4645af1f425d026712c150bca40edc8712205..581b4fc9b689334857a3380d7e0af05b2e0ab945 100644 (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)
index ade11366e5ee4311c9a8ea2d9c011069b8c85323..ab11f6ff6690b01ad0ee5f977a278496e74443c3 100644 (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()
 
index bbca040994e5aaa64e98b690ed7cda90a0396fb2..dbe3dbcffc0eeb3b8a6f82a412695f49ad7e6588 100644 (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
index 6bcd3445d3e11e5a3a89826efc0eed073d5453c6..fc126cad7d2246ab5436d0c7d0e1f9eacbcdd6b8 100644 (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)
index 890b96b673d434aeeef210be85718204091d1449..963678a2c3c8a82c812173f8a06a48a9a2d25431 100644 (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)
index f71f5ccead6f15ee3fe7306d3bb20aab06d95a4d..2c026c8d0dba63327c373bc80f06a96277427d52 100644 (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()
 
index a9cb1fbafe1f276c0b63e751efe99fa00f0efba0..e03cfb52f60fdf67589adbb21b213f8ddaba7684 100644 (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
index 4a3f2fc3a2acb85a8fd49e5707be8b42cf6e3ce5..db92326efbaec588359666132b7b60de19a6247a 100644 (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)
index 3b18bdda7a721ae1f5cd0fe0cf496fe78322996a..c2b209205315f2aef71cdaae963df8a2b33854dc 100644 (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
index 24d2d61df0804f85a860516652729483d6f31a67..7376e065a027c08305e975a830efa7718ff0ffec 100644 (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