diff options
| author | Keith Randall <khr@golang.org> | 2025-04-14 09:52:31 -0700 |
|---|---|---|
| committer | Carlos Amedee <carlos@golang.org> | 2025-04-28 10:29:49 -0700 |
| commit | 8ff45d1aa09d77d708a0ec4921817c6e6ee7ca85 (patch) | |
| tree | 75974574aac3b4ff7db97b9cfa9e612665b5b44c | |
| parent | 96537d504423f332bfa2e8335a936a041c46206c (diff) | |
| download | go-8ff45d1aa09d77d708a0ec4921817c6e6ee7ca85.tar.xz | |
[release-branch.go1.23] runtime: fix 9-arg syscall on darwin/amd64
The last 3 arguments need to be passed on the stack, not registers.
Fixes #73380
Change-Id: Ib1155ad1a805957fad3d9594c93981a558755591
Reviewed-on: https://go-review.googlesource.com/c/go/+/665435
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@google.com>
(cherry picked from commit 9d7de0483861b3f882f79797939566fe8f6f9e24)
Reviewed-on: https://go-review.googlesource.com/c/go/+/666015
| -rw-r--r-- | src/runtime/sys_darwin_amd64.s | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/runtime/sys_darwin_amd64.s b/src/runtime/sys_darwin_amd64.s index 01992d59d4..408d52a173 100644 --- a/src/runtime/sys_darwin_amd64.s +++ b/src/runtime/sys_darwin_amd64.s @@ -739,7 +739,7 @@ ok: // // syscall9 expects a 32-bit result and tests for 32-bit -1 // to decide there was an error. -TEXT runtime·syscall9(SB),NOSPLIT,$16 +TEXT runtime·syscall9(SB),NOSPLIT,$32 MOVQ (0*8)(DI), R13// fn MOVQ (2*8)(DI), SI // a2 MOVQ (3*8)(DI), DX // a3 @@ -747,15 +747,18 @@ TEXT runtime·syscall9(SB),NOSPLIT,$16 MOVQ (5*8)(DI), R8 // a5 MOVQ (6*8)(DI), R9 // a6 MOVQ (7*8)(DI), R10 // a7 + MOVQ R10, 0(SP) MOVQ (8*8)(DI), R11 // a8 + MOVQ R11, 8(SP) MOVQ (9*8)(DI), R12 // a9 - MOVQ DI, (SP) + MOVQ R12, 16(SP) + MOVQ DI, 24(SP) MOVQ (1*8)(DI), DI // a1 XORL AX, AX // vararg: say "no float args" CALL R13 - MOVQ (SP), DI + MOVQ 24(SP), DI MOVQ AX, (10*8)(DI) // r1 MOVQ DX, (11*8)(DI) // r2 @@ -764,7 +767,7 @@ TEXT runtime·syscall9(SB),NOSPLIT,$16 CALL libc_error(SB) MOVLQSX (AX), AX - MOVQ (SP), DI + MOVQ 24(SP), DI MOVQ AX, (12*8)(DI) // err ok: |
