aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorMeng Zhuo <mengzhuo1203@gmail.com>2024-09-12 20:15:56 +0800
committerMeng Zhuo <mengzhuo@iscas.ac.cn>2025-02-19 17:54:34 -0800
commitcdc95607940b2acb66cb184dec08d4cc8a469042 (patch)
treeba916b940165a00c7b47299369328213bcd10652 /src/runtime
parent58083b57d4f8047d2749196a09b366926e8698da (diff)
downloadgo-cdc95607940b2acb66cb184dec08d4cc8a469042.tar.xz
all: implement plugin build mode for riscv64
Change-Id: I8d7bbeebbf4a46f2fd8d630b1edbaf79b8ffccc5 Reviewed-on: https://go-review.googlesource.com/c/go/+/420114 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Joel Sing <joel@sing.id.au> TryBot-Bypass: Joel Sing <joel@sing.id.au>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/asm_riscv64.s9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/runtime/asm_riscv64.s b/src/runtime/asm_riscv64.s
index ef654a3a22..71b32304d7 100644
--- a/src/runtime/asm_riscv64.s
+++ b/src/runtime/asm_riscv64.s
@@ -541,6 +541,15 @@ TEXT runtime·goexit(SB),NOSPLIT|NOFRAME|TOPFRAME,$0-0
// traceback from goexit1 must hit code range of goexit
MOV ZERO, ZERO // NOP
+
+// This is called from .init_array and follows the platform, not the Go ABI.
+TEXT runtime·addmoduledata(SB),NOSPLIT,$0-0
+ // Use X31 as it is a scratch register in both the Go ABI and psABI.
+ MOV runtime·lastmoduledatap(SB), X31
+ MOV X10, moduledata_next(X31)
+ MOV X10, runtime·lastmoduledatap(SB)
+ RET
+
// func cgocallback(fn, frame unsafe.Pointer, ctxt uintptr)
// See cgocall.go for more details.
TEXT ·cgocallback(SB),NOSPLIT,$24-24