aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/symtab.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2023-01-12 20:25:39 -0800
committerKeith Randall <khr@golang.org>2023-04-14 16:55:22 +0000
commit2b92c39fe08101ed8c9f032d577df4cc882d08d7 (patch)
tree1446e0a68fa6fb81fdd141a241e8b818e6343151 /src/runtime/symtab.go
parentd4bcfe4e834da1d31b7071e83eb045e089271175 (diff)
downloadgo-2b92c39fe08101ed8c9f032d577df4cc882d08d7.tar.xz
cmd/link: establish dependable package initialization order
(This is a retry of CL 462035 which was reverted at 474976. The only change from that CL is the aix fix SRODATA->SNOPTRDATA at inittask.go:141) As described here: https://github.com/golang/go/issues/31636#issuecomment-493271830 "Find the lexically earliest package that is not initialized yet, but has had all its dependencies initialized, initialize that package, and repeat." Simplify the runtime a bit, by just computing the ordering required in the linker and giving a list to the runtime. Update #31636 Fixes #57411 RELNOTE=yes Change-Id: I28c09451d6aa677d7394c179d23c2c02c503fc56 Reviewed-on: https://go-review.googlesource.com/c/go/+/478916 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/runtime/symtab.go')
-rw-r--r--src/runtime/symtab.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtime/symtab.go b/src/runtime/symtab.go
index e2533ae250..7bf96c31fc 100644
--- a/src/runtime/symtab.go
+++ b/src/runtime/symtab.go
@@ -446,6 +446,10 @@ type moduledata struct {
pluginpath string
pkghashes []modulehash
+ // This slice records the initializing tasks that need to be
+ // done to start up the program. It is built by the linker.
+ inittasks []*initTask
+
modulename string
modulehashes []modulehash