aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorCherry Zhang <cherryyz@google.com>2021-04-22 11:12:21 -0400
committerCherry Zhang <cherryyz@google.com>2021-04-22 16:15:44 +0000
commitd3853fb4e6ee2b9f873ab2e41adc0e62a82e73e4 (patch)
tree22dfb05ab32cc86240cb485bd28b2a427f8253d6 /src/runtime
parentd5b2d809b09b5a7404ad334a5e56b2210a06254c (diff)
downloadgo-d3853fb4e6ee2b9f873ab2e41adc0e62a82e73e4.tar.xz
runtime: call cgocallbackg indirectly
cgocallback calls cgocallbackg after switching the stack. Call it indirectly to bypass the linker's nosplit check. Apparently (at least on Windows) cgocallbackg can use quite a bit stack space in a nosplit chain. We have been running over the nosplit limit, or very close to the limit. Since it switches stack in cgocallback, it is not meaningful to count frames above cgocallback and below cgocallbackg together. Bypass the check. For #45658. Change-Id: Ie22017e3f82d2c1fcc37336696f2d02757856399 Reviewed-on: https://go-review.googlesource.com/c/go/+/312669 Trust: Cherry Zhang <cherryyz@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Run-TryBot: Cherry Zhang <cherryyz@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/asm_amd64.s3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/runtime/asm_amd64.s b/src/runtime/asm_amd64.s
index d2848e5a45..789e159c76 100644
--- a/src/runtime/asm_amd64.s
+++ b/src/runtime/asm_amd64.s
@@ -911,7 +911,8 @@ havem:
MOVQ BX, 0(SP)
MOVQ CX, 8(SP)
MOVQ DX, 16(SP)
- CALL runtime·cgocallbackg(SB)
+ MOVQ $runtime·cgocallbackg(SB), AX
+ CALL AX // indirect call to bypass nosplit check. We're on a different stack now.
// Compute the size of the frame again. FP and SP have
// completely different values here than they did above,