1
0
mirror of https://github.com/golang/go synced 2024-11-24 00:30:15 -07:00
go/misc/cgo
Michael Hudson-Doyle 956e9e6c83 cmd/link: do not add duplicate symbols to Allsym
When building shared libraries, all symbols on Allsym are marked reachable.
What I didn't realize was that this includes the ".dup" symbols created when
"dupok" symbols are read from multiple package files. This breaks now because
deadcode makes some assumptions that fail for these ".dup" symbols, but in any
case was a bad idea -- I suspect this change makes libstd.so a bunch smaller,
but creating it was broken before this CL so I can't be sure.

This change simply stops adding these symbols to Allsym, which might make some
of the many iterations over Allsym the linker does a touch quicker, although
that's not the motivation here.

Add a test that no symbols called ".dup" makes it into the runtime shared
library.

Fixes #14841

Change-Id: I65dd6e88d150a770db2d01b75cfe5db5fd4f8d25
Reviewed-on: https://go-review.googlesource.com/20780
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2016-03-17 01:15:19 +00:00
..
errors cmd/cgo: recognize known C typedefs as types 2016-02-27 22:51:51 +00:00
fortran misc/cgo/fortran: clean up after successful helloworld.90 build 2016-02-28 04:30:41 +00:00
gmp misc/cgo/gmp: change pi.go to use standard Go copyright header 2015-12-11 13:29:46 +00:00
life misc/cgo/stdio: reenable tests 2015-12-05 21:24:30 +00:00
nocgo
stdio misc/cgo/stdio: reenable tests 2015-12-05 21:24:30 +00:00
test cmd/cgo: add C.CBytes 2016-03-16 23:22:10 +00:00
testasan
testcarchive cmd/link: add -extar option to set ar program for c-archive 2016-01-26 18:52:36 +00:00
testcshared misc/cgo: fix wrong quote character 2016-02-26 19:39:51 +00:00
testgodefs
testsanitizers misc/cgo/testsanitizers: don't run tsan tests on old clang 2016-03-01 00:56:14 +00:00
testshared cmd/link: do not add duplicate symbols to Allsym 2016-03-17 01:15:19 +00:00
testsigfwd runtime: for c-archive/c-shared, don't install unnecessary signal handlers 2015-12-18 22:27:38 +00:00
testso
testsovar
testtls