go/misc
Cherry Zhang 98f8454a73 cmd/link: don't decode type symbol in shared library in deadcode
In the linker's deadcode pass we decode type symbols for
interface satisfaction analysis. When linking against Go shared
libraries, the type symbol may come from a shared library, so it
doesn't have data in the current module being linked, so we cannot
decode it. We already have code to skip DYNIMPORT symbols. However,
this doesn't actually work, because at that point the type symbols'
names haven't been mangled, whereas they may be mangled in the
shared library. So the symbol definition (in shared library) and
reference (in current module) haven't been connected.

Skip decoding type symbols of type Sxxx (along with DYNIMPORT)
when linkShared.

Note: we cannot skip all type symbols, as we still need to mark
unexported methods defined in the current module.

Fixes #44031.

Change-Id: I833d19a060c94edbd6fc448172358f9a7d760657
Reviewed-on: https://go-review.googlesource.com/c/go/+/288496
Trust: Cherry Zhang <cherryyz@google.com>
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
2021-02-02 16:00:58 +00:00
..
android misc/android: fix a typo in README 2019-05-17 06:01:17 +00:00
arm all: make copyright headers consistent with one space after period 2016-05-02 13:43:18 +00:00
cgo cmd/link: don't decode type symbol in shared library in deadcode 2021-02-02 16:00:58 +00:00
chrome/gophertool misc/chrome/gophertool: replace deprecated tabs.getSelected method 2019-11-18 18:14:37 +00:00
ios misc/ios: fix wording for command line instructions 2020-12-29 21:49:26 +00:00
linkcheck misc/linkcheck: better redirect handling, use meaningful exit code 2013-10-25 17:31:02 +03:00
reboot misc: remove use of relative directories in overlayDir functions 2019-11-25 16:26:15 +00:00
swig cmd/go: fix swig support and run swig tests during run.bash 2017-11-16 17:19:19 +00:00
trace cmd/trace: update to use WebComponents V0 polyfill 2020-02-20 19:12:11 +00:00
wasm misc/wasm: check type of argument to Go.run 2020-11-02 13:02:40 +00:00
editors all: don't refer to code.google.com/p/go{,-wiki}/ 2015-02-06 14:41:47 +00:00
go.mod misc: add go.mod file 2019-02-27 17:47:31 +00:00