aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2026-02-23 10:56:29 +0100
committerQuim Muntal <quimmuntal@gmail.com>2026-02-23 21:56:58 -0800
commitbdd4c38ce3c568efaf274281c40ecc6288c655a6 (patch)
treed1b6a2e0afd563d49d19ef0d55f867a00edfcf56 /src/runtime
parent5e6a6840ae64c60a14d4c027720af5d82710e39f (diff)
downloadgo-bdd4c38ce3c568efaf274281c40ecc6288c655a6.tar.xz
runtime/cgo: fix setg_gcc call on aix/ppc64
aix/ppc64 uses function descriptors instead of function pointers. CL 708235 assumed the latter, which caused a crash when calling setg_gcc. Fix the call by dereferencing the function descriptor to get the entry point and TOC. Tested using gomote, as LUCI builders still don't support aix/ppc64. Fixes #77753. Change-Id: I6a0a6e971341f18f400c044f47b0daa42b93599e Reviewed-on: https://go-review.googlesource.com/c/go/+/747960 Run-TryBot: Paul Murphy <paumurph@redhat.com> Reviewed-by: Paul Murphy <paumurph@redhat.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Mark Freeman <markfreeman@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/cgo/gcc_aix_ppc64.S5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/runtime/cgo/gcc_aix_ppc64.S b/src/runtime/cgo/gcc_aix_ppc64.S
index 740bf5dbef..616d4c5ffc 100644
--- a/src/runtime/cgo/gcc_aix_ppc64.S
+++ b/src/runtime/cgo/gcc_aix_ppc64.S
@@ -40,8 +40,11 @@ crosscall1:
mr 30, 5
// Call setg_gcc(g)
+ // Function pointers are function descriptors.
+ // Dereference setg_gcc to get the entry point and TOC.
mr 3, 5 // arg g
- mr 12, 4 // setg_gcc
+ ld 12, 0(4) // load entry point from function descriptor
+ ld 2, 8(4) // load TOC from function descriptor
mtctr 12
bctrl