go/misc/cgo/testshared/src
David Crawshaw b531eb3062 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>
2017-01-25 22:33:57 +00:00
..
dep2 cmd/link: always read type data for dynimport symbols 2016-05-04 07:13:01 +00:00
dep3 cmd/link: always read type data for dynimport symbols 2016-05-04 07:13:01 +00:00
depBase runtime: reorder modules so main.main comes first 2017-01-25 22:33:57 +00:00
exe runtime: reorder modules so main.main comes first 2017-01-25 22:33:57 +00:00
exe2 cmd/compile: do not generate tail calls when dynamic linking on ppc64le 2016-06-02 02:34:01 +00:00
exe3 cmd/link: always read type data for dynimport symbols 2016-05-04 07:13:01 +00:00
execgo cmd/link: when reading symbols from a shared library, allow duplicates when they are both in bss 2015-06-16 22:33:36 +00:00
explicit cmd/link: allow symbols from .a files to override those from .so files 2016-01-20 19:53:53 +00:00
iface misc/cgo/testshared: test that types and itabs are unique 2017-01-12 00:20:55 +00:00
iface_a misc/cgo/testshared: test that types and itabs are unique 2017-01-12 00:20:55 +00:00
iface_b misc/cgo/testshared: test that types and itabs are unique 2017-01-12 00:20:55 +00:00
iface_i misc/cgo/testshared: test that types and itabs are unique 2017-01-12 00:20:55 +00:00
implicit cmd/link: allow symbols from .a files to override those from .so files 2016-01-20 19:53:53 +00:00
implicitcmd cmd/link: allow symbols from .a files to override those from .so files 2016-01-20 19:53:53 +00:00
trivial