aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/proc.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 263945dd6c..fa76d3250c 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -244,8 +244,10 @@ func main() {
// list can arrive a few different ways, but it will always
// contain the init tasks computed by the linker for all the
// packages in the program (excluding those added at runtime
- // by package plugin).
- for _, m := range activeModules() {
+ // by package plugin). Run through the modules in dependency
+ // order (the order they are initialized by the dynamic
+ // loader, i.e. they are added to the moduledata linked list).
+ for m := &firstmoduledata; m != nil; m = m.next {
doInit(m.inittasks)
}