aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/cgo
diff options
context:
space:
mode:
authorJoel Sing <joel@sing.id.au>2023-03-14 20:50:38 +1100
committerJoel Sing <joel@sing.id.au>2023-03-18 06:28:23 +0000
commit6827f0d7722ae08cf25cf2212f78bfc6ab8bfd0d (patch)
treef53e2c6c72a84ab0eaf4ab5aaee07bd2a17a86fd /src/runtime/cgo
parentada6ffca8399af9ad24e82502db1429b85b7405f (diff)
downloadgo-6827f0d7722ae08cf25cf2212f78bfc6ab8bfd0d.tar.xz
runtime: provide and use a GO_PPC64X_HAS_FUNCDESC define
Rather than implying that all ppc64 GOARCHs use function descriptors, provide a define for platforms that make use of function descriptors. Condition on GO_PPC64X_HAS_FUNCDESC when choosing whether or not to load the entry address from the first slot of the function descriptor. Updates #56001. Change-Id: I9cdc788f2de70a1262c17d8485b555383d1374b5 Reviewed-on: https://go-review.googlesource.com/c/go/+/476117 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Run-TryBot: Joel Sing <joel@sing.id.au> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime/cgo')
-rw-r--r--src/runtime/cgo/asm_ppc64x.s6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/runtime/cgo/asm_ppc64x.s b/src/runtime/cgo/asm_ppc64x.s
index c201005044..fea749670b 100644
--- a/src/runtime/cgo/asm_ppc64x.s
+++ b/src/runtime/cgo/asm_ppc64x.s
@@ -30,10 +30,8 @@ TEXT crosscall2(SB),NOSPLIT|NOFRAME,$0
BL runtimeĀ·reginit(SB)
BL runtimeĀ·load_g(SB)
-#ifdef GOARCH_ppc64
- // ppc64 use elf ABI v1. we must get the real entry address from
- // first slot of the function descriptor before call.
- // Same for AIX.
+#ifdef GO_PPC64X_HAS_FUNCDESC
+ // Load the real entry address from the first slot of the function descriptor.
MOVD 8(R3), R2
MOVD (R3), R3
#endif