aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2025-12-06 22:00:20 -0800
committerDavid Chase <drchase@google.com>2025-12-09 09:33:40 -0800
commitb9693a2d9a89168b86cf01033b8420bf8db652d6 (patch)
tree778970ab9611ba62e62b0970abc25c4d0d1ddee5 /src/runtime
parent1274d58dacc92204f5bb233b22a93c30a37f34e5 (diff)
downloadgo-b9693a2d9a89168b86cf01033b8420bf8db652d6.tar.xz
runtime: on AIX check isarchive before calling libpreinit
On AIX, all externally linked programs call _rt0_ppc64_aix_lib, as seen in runtime/cgo/gcc_aix_ppc64.c. The idea is that we only do the library initialization is isarchive is set. However, before this CL, AIX programs would call libpreinit before checking isarchive. The effect was that signals were initialized twice. That caused the signal code to record that all signals had an existing forwarding address, namely the Go signal handler that was always installed. This caused signal forwarding to enter an infinite loop. This caused, for example, "go test os" to hang forever when running TestStdPipe. Fixes #76081 Change-Id: I5555f8c5e299d45549f5ce601568dc6b3cff4ecc Reviewed-on: https://go-review.googlesource.com/c/go/+/727820 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Keith Randall <khr@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/asm_ppc64x.s7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/runtime/asm_ppc64x.s b/src/runtime/asm_ppc64x.s
index aaa2e4346c..ffc4b005cb 100644
--- a/src/runtime/asm_ppc64x.s
+++ b/src/runtime/asm_ppc64x.s
@@ -30,9 +30,6 @@ TEXT _rt0_ppc64x_lib(SB),NOSPLIT|NOFRAME,$0
MOVD $runtime·reginit(SB), R12
MOVD R12, CTR
BL (CTR)
- MOVD $runtime·libpreinit(SB), R12
- MOVD R12, CTR
- BL (CTR)
#ifdef GOOS_aix
// See runtime/cgo/gcc_aix_ppc64.c
@@ -41,6 +38,10 @@ TEXT _rt0_ppc64x_lib(SB),NOSPLIT|NOFRAME,$0
BEQ done
#endif
+ MOVD $runtime·libpreinit(SB), R12
+ MOVD R12, CTR
+ BL (CTR)
+
// Create a new thread to do the runtime initialization and return.
// _cgo_sys_thread_create is a C function.
MOVD _cgo_sys_thread_create(SB), R12