aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2026-02-03 15:10:09 +0000
committerMichael Knyszek <mknyszek@google.com>2026-02-18 13:48:09 -0800
commitfb0c8e16c329da6f0caafa2d5ae48e625a00b652 (patch)
tree911cbdd85f5d3e1c0a8e7e8ec8aaef90fde76276 /src/runtime
parentf40560ff89eac34709f5fee56ebf71bfb2c4065c (diff)
downloadgo-fb0c8e16c329da6f0caafa2d5ae48e625a00b652.tar.xz
runtime: update comments about known g offsets
I can't find any evidence that most of these offsets are hard-coded anymore, and the locations they reference (liblink, libmach) definitely don't exist anymore. The stackguards are much more obviously hard-coded into and referenced from cmd/internal/obj/*, so update that reference. Change-Id: I814584846a85353a6373193ea9cd802ace1ed5ad Reviewed-on: https://go-review.googlesource.com/c/go/+/741540 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Cherry Mui <cherryyz@google.com>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/runtime2.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/runtime/runtime2.go b/src/runtime/runtime2.go
index bf47955d0d..578458afa0 100644
--- a/src/runtime/runtime2.go
+++ b/src/runtime/runtime2.go
@@ -301,8 +301,6 @@ func setMNoWB(mp **m, new *m) {
}
type gobuf struct {
- // The offsets of sp, pc, and g are known to (hard-coded in) libmach.
- //
// ctxt is unusual with respect to GC: it may be a
// heap-allocated funcval, so GC needs to track it, but it
// needs to be set and cleared from assembly, where it's
@@ -479,12 +477,12 @@ type g struct {
// It is stack.lo+StackGuard on g0 and gsignal stacks.
// It is ~0 on other goroutine stacks, to trigger a call to morestackc (and crash).
stack stack // offset known to runtime/cgo
- stackguard0 uintptr // offset known to liblink
- stackguard1 uintptr // offset known to liblink
+ stackguard0 uintptr // offset known to cmd/internal/obj/*
+ stackguard1 uintptr // offset known to cmd/internal/obj/*
- _panic *_panic // innermost panic - offset known to liblink
+ _panic *_panic // innermost panic
_defer *_defer // innermost defer
- m *m // current m; offset known to arm liblink
+ m *m // current m
sched gobuf
syscallsp uintptr // if status==Gsyscall, syscallsp = sched.sp to use during gc
syscallpc uintptr // if status==Gsyscall, syscallpc = sched.pc to use during gc