From: Cherry Mui Date: Wed, 2 Jun 2021 23:43:28 +0000 (-0400) Subject: [dev.typeparams] runtime: call cgocallbackg indirectly on ARM64 X-Git-Tag: go1.18beta1~1818^2^2~432 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3de4986852;p=gostls13.git [dev.typeparams] runtime: call cgocallbackg indirectly on ARM64 This is CL 312669, for ARM64. cgocallback calls cgocallbackg after switching the stack. Call it indirectly to bypass the linker's nosplit check. In particular, this avoids a nosplit stack overflow on Windows when register ABI is enabled. Change-Id: I7054a750fb0ec2579d46004f94b46b6f7b9e3a21 Reviewed-on: https://go-review.googlesource.com/c/go/+/324734 Trust: Cherry Mui Run-TryBot: Cherry Mui TryBot-Result: Go Bot Reviewed-by: Michael Knyszek --- diff --git a/src/runtime/asm_arm64.s b/src/runtime/asm_arm64.s index 4babcc7fcb..be4313d35d 100644 --- a/src/runtime/asm_arm64.s +++ b/src/runtime/asm_arm64.s @@ -1196,7 +1196,8 @@ havem: MOVD R1, 8(RSP) MOVD R2, 16(RSP) MOVD R3, 24(RSP) - BL runtime·cgocallbackg(SB) + MOVD $runtime·cgocallbackg(SB), R0 + CALL (R0) // indirect call to bypass nosplit check. We're on a different stack now. // Restore g->sched (== m->curg->sched) from saved values. MOVD 0(RSP), R5