Skip to content

Commit f03c392

Browse files
committed
runtime: fix aix/ppc64 library initialization
AIX sets the argc and argv parameters in R14 and R15, but _rt0_ppc64x_lib expects them to be in R3 and R4. Also, call reginit in _rt0_ppc64x_lib. These issues were oversights from CL 706395 which went unnoticed because there if no LUCI aix/ppc64 builder (see #67299). Change-Id: I93a2798739935fbcead3e6162b4b90db7e740aa5 Reviewed-on: https://go-review.googlesource.com/c/go/+/708255 Reviewed-by: Carlos Amedee <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Junyang Shao <[email protected]> Reviewed-by: Paul Murphy <[email protected]>
1 parent 707454b commit f03c392

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/runtime/asm_ppc64x.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ TEXT _rt0_ppc64x_lib(SB),NOSPLIT|NOFRAME,$0
2121
MOVD R4, _rt0_ppc64x_lib_argv<>(SB)
2222

2323
// Synchronous initialization.
24+
MOVD $runtime·reginit(SB), R12
25+
MOVD R12, CTR
26+
BL (CTR)
2427
MOVD $runtime·libpreinit(SB), R12
2528
MOVD R12, CTR
2629
BL (CTR)

src/runtime/rt0_aix_ppc64.s

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,6 @@ TEXT _main(SB),NOSPLIT,$-8
4242
BR (CTR)
4343

4444
TEXT _rt0_ppc64_aix_lib(SB),NOSPLIT,$0
45+
MOVD R14, R3 // argc
46+
MOVD R15, R4 // argv
4547
JMP _rt0_ppc64x_lib(SB)

0 commit comments

Comments
 (0)