aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/cgo/gcc_libinit.c
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2025-09-30 17:23:49 +0200
committerQuim Muntal <quimmuntal@gmail.com>2026-02-13 09:11:10 -0800
commit8a0bc29bedd45324c52cfdc7717fabfc82673e4d (patch)
tree75ce69c04d6a554494bef8e64e7c271968f53083 /src/runtime/cgo/gcc_libinit.c
parent65b9017c0e955ad57fb42c3bf82aa0ff51ddbff5 (diff)
downloadgo-8a0bc29bedd45324c52cfdc7717fabfc82673e4d.tar.xz
runtime/cgo: deduplicate x_cgo_init and crosscall1
Most platforms share the same implementation for x_cgo_init and crosscall1. Solaris diverges too much and is left for a future CL. Cq-Include-Trybots: luci.golang.try:gotip-freebsd-amd64,gotip-darwin-amd64_14,gotip-darwin-arm64_15,gotip-netbsd-arm64,gotip-openbsd-ppc64,gotip-solaris-amd64,gotip-linux-ppc64_power10 Change-Id: Ib2eeb6456caa5c055e1ac1907c2fdf63db58dafc Reviewed-on: https://go-review.googlesource.com/c/go/+/708035 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Junyang Shao <shaojunyang@google.com>
Diffstat (limited to 'src/runtime/cgo/gcc_libinit.c')
-rw-r--r--src/runtime/cgo/gcc_libinit.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/runtime/cgo/gcc_libinit.c b/src/runtime/cgo/gcc_libinit.c
index 4b163c2d19..9d2402636e 100644
--- a/src/runtime/cgo/gcc_libinit.c
+++ b/src/runtime/cgo/gcc_libinit.c
@@ -83,30 +83,6 @@ _cgo_wait_runtime_init_done(void) {
return 0;
}
-// _cgo_set_stacklo sets g->stacklo based on the stack size.
-// This is common code called from x_cgo_init, which is itself
-// called by rt0_go in the runtime package.
-void _cgo_set_stacklo(G *g, uintptr *pbounds)
-{
- uintptr bounds[2];
-
- // pbounds can be passed in by the caller; see gcc_linux_amd64.c.
- if (pbounds == NULL) {
- pbounds = &bounds[0];
- }
-
- x_cgo_getstackbound(pbounds);
-
- g->stacklo = *pbounds;
-
- // Sanity check the results now, rather than getting a
- // morestack on g0 crash.
- if (g->stacklo >= g->stackhi) {
- fprintf(stderr, "runtime/cgo: bad stack bounds: lo=%p hi=%p\n", (void*)(g->stacklo), (void*)(g->stackhi));
- abort();
- }
-}
-
// Store the g into a thread-specific value associated with the pthread key pthread_g.
// And pthread_key_destructor will dropm when the thread is exiting.
void x_cgo_bindm(void* g) {