]> git.feebdaed.xyz Git - 0xmirror/go.git/commitdiff
runtime: revert entry point on freebsd/arm64
authorRob Nichols <robert.nichols@dialwave.com>
Mon, 22 Dec 2025 21:25:08 +0000 (21:25 +0000)
committerGopher Robot <gobot@golang.org>
Tue, 23 Dec 2025 00:19:29 +0000 (16:19 -0800)
CL 706175 unified some arm64 entry points. However, the entry point for
freebsd/arm64 is incorrect and builds now fail. This change reverts the
freebsd/arm64 entry point and adds additional context for the future.

Fixes #76958

Change-Id: Ib9e9b7844706f7b0ef54bd449411fefc8f10bc43
GitHub-Last-Rev: 70064d8126f8ff7e2c0e5e8d4b00177c627f4d76
GitHub-Pull-Request: golang/go#76959
Reviewed-on: https://go-review.googlesource.com/c/go/+/731980
Auto-Submit: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/runtime/rt0_freebsd_arm64.s

index a7a952664e575b2134ddc5231a5a67f8adce02ca..93562c5dd065e22417f1300caaa853608a7e1459 100644 (file)
@@ -4,9 +4,12 @@
 
 #include "textflag.h"
 
-// On FreeBSD argc/argv are passed in R0, not RSP
+// FreeBSD passes a pointer to the argument block in R0, not RSP,
+// so _rt0_arm64 cannot be used.
 TEXT _rt0_arm64_freebsd(SB),NOSPLIT,$0
-       JMP     _rt0_arm64(SB)
+       ADD     $8, R0, R1      // argv (use R0 while it's still the pointer)
+       MOVD    0(R0), R0       // argc
+       JMP     runtime·rt0_go(SB)
 
 // When building with -buildmode=c-shared, this symbol is called when the shared
 // library is loaded.