go/misc/cgo/testshared/src
Michael Hudson-Doyle 2f41edf120 cmd/link: always read type data for dynimport symbols
Consider three shared libraries:

 libBase.so -- defines a type T
 lib2.so    -- references type T
 lib3.so    -- also references type T, and something from lib2

lib2.so will contain a type symbol for T in its symbol table, but no
definition. If, when linking lib3.so the linker reads the symbols from lib2.so
before libBase.so, the linker didn't read the type data and later crashed.

The fix is trivial but the test change is a bit messy because the order the
linker reads the shared libraries in ends up depending on the order of the
import statements in the file so I had to rename one of the test packages so
that gofmt doesn't fix the test by accident...

Fixes #15516

Change-Id: I124b058f782c900a3a54c15ed66a0d91d0cde5ce
Reviewed-on: https://go-review.googlesource.com/22744
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-05-04 07:13:01 +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 cmd/link: always read type data for dynimport symbols 2016-05-04 07:13:01 +00:00
exe cmd/link: always read type data for dynimport symbols 2016-05-04 07:13:01 +00:00
exe2 cmd/internal/ld: store the libraries a shared library was linked against in a note 2015-05-27 13:25:32 +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
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