aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Crawshaw <crawshaw@golang.org>2017-01-12 17:35:53 -0500
committerDavid Crawshaw <crawshaw@golang.org>2017-01-12 23:48:11 +0000
commit9cf06ed6cd624ab1d84acbabf30d57b9753651c0 (patch)
treeddf20f23f350a544e4e9d0832782282d50cc829f
parent9c3630f578db1d4331b367c3c7d284db299be3a6 (diff)
downloadgo-9cf06ed6cd624ab1d84acbabf30d57b9753651c0.tar.gz
go-9cf06ed6cd624ab1d84acbabf30d57b9753651c0.zip
cmd/link: only exclude C-only symbols on darwin
C-only symbols are excluded from pclntab because of a quirk of darwin, where functions are referred to by an exported symbol so dynamic relocations de-duplicate to the host binary module and break unwinding. This doesn't happen on ELF systems because the linker always refers to unexported module-local symbols, so we don't need this condition. And the current logic for excluding some functions breaks the module verification code in moduledataverify1. So disable this for plugins on linux. (In 1.9, it will probably be necessary to introduce a module-local symbol reference system on darwin to fix a different bug, so all of this onlycsymbol code made be short-lived.) With this CL, the tests in CL 35116 pass. Change-Id: I517d7ca4427241fa0a91276c462827efb9383be9 Reviewed-on: https://go-review.googlesource.com/35190 Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com> Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
-rw-r--r--src/cmd/link/internal/ld/pcln.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/link/internal/ld/pcln.go b/src/cmd/link/internal/ld/pcln.go
index 1ebd7de662..479425f211 100644
--- a/src/cmd/link/internal/ld/pcln.go
+++ b/src/cmd/link/internal/ld/pcln.go
@@ -168,7 +168,7 @@ func container(s *Symbol) int {
if s == nil {
return 0
}
- if Buildmode == BuildmodePlugin && onlycsymbol(s) {
+ if Buildmode == BuildmodePlugin && Headtype == obj.Hdarwin && onlycsymbol(s) {
return 1
}
// We want to generate func table entries only for the "lowest level" symbols,