]> Cypherpunks repositories - gostls13.git/commit
runtime: reorder modules so main.main comes first
authorDavid Crawshaw <crawshaw@golang.org>
Wed, 25 Jan 2017 04:19:36 +0000 (20:19 -0800)
committerDavid Crawshaw <crawshaw@golang.org>
Wed, 25 Jan 2017 22:33:57 +0000 (22:33 +0000)
commitb531eb30625a28eb99f9b0137ea5a409a733a1bb
tree7fa26ff7b203aaa318e0b40af868338f55ff7cbf
parent165cfbc409d54154263c26fb0cc2b2acd75d8b53
runtime: reorder modules so main.main comes first

Modules appear in the moduledata linked list in the order they are
loaded by the dynamic loader, with one exception: the
firstmoduledata itself the module that contains the runtime.
This is not always the first module (when using -buildmode=shared,
it is typically libstd.so, the second module).

The order matters for typelinksinit, so we swap the first module
with whatever module contains the main function.

Updates #18729

This fixes the test case extracted with -linkshared, and now

go test -linkshared encoding/...

passes. However the original issue about a plugin failure is not
yet fixed.

Change-Id: I9f399ecc3518e22e6b0a350358e90b0baa44ac96
Reviewed-on: https://go-review.googlesource.com/35644
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
misc/cgo/testshared/src/depBase/dep.go
misc/cgo/testshared/src/exe/exe.go
src/runtime/symtab.go