From e79c2fd428372f64e6183bed9f765c1556816111 Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Tue, 2 Feb 2021 18:09:03 -0500 Subject: [PATCH] [dev.regabi] runtime: mark racecallbackthunk as ABIInternal racecallbackthunk is called from C, and it needs to follow C ABI. The assembly code preserves C callee-save registers. It must not be called via wrappers, which may not preserve those registers. Change-Id: Icd72c399f4424d73c4882860d85057fe2671f6aa Reviewed-on: https://go-review.googlesource.com/c/go/+/289194 Trust: Cherry Zhang Reviewed-by: Than McIntosh --- src/runtime/race_amd64.s | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/runtime/race_amd64.s b/src/runtime/race_amd64.s index 9818bc6ddf..cf0a51462f 100644 --- a/src/runtime/race_amd64.s +++ b/src/runtime/race_amd64.s @@ -419,7 +419,9 @@ call: // The overall effect of Go->C->Go call chain is similar to that of mcall. // RARG0 contains command code. RARG1 contains command-specific context. // See racecallback for command codes. -TEXT runtime·racecallbackthunk(SB), NOSPLIT, $56-8 +// Defined as ABIInternal so as to avoid introducing a wrapper, +// because its address is passed to C via funcPC. +TEXT runtime·racecallbackthunk(SB), NOSPLIT, $56-8 // Handle command raceGetProcCmd (0) here. // First, code below assumes that we are on curg, while raceGetProcCmd // can be executed on g0. Second, it is called frequently, so will -- 2.50.0