diff options
author | David Crawshaw <crawshaw@golang.org> | 2016-11-08 13:59:25 -0500 |
---|---|---|
committer | David Crawshaw <crawshaw@golang.org> | 2016-11-11 00:10:03 +0000 |
commit | eb4e17b73b4ad486f9e9b0ea0fe2a6050ceb54fc (patch) | |
tree | ed33c8cd162001a0996683f2f06d40a1faccede3 | |
parent | 7bdb77af5fea5b94cf3d5d7840ca9162e76b3e9b (diff) | |
download | go-eb4e17b73b4ad486f9e9b0ea0fe2a6050ceb54fc.tar.gz go-eb4e17b73b4ad486f9e9b0ea0fe2a6050ceb54fc.zip |
cmd/link: use plugin path in visibility analysis
CL 32355 switched from using the output file as a
plugin prefix to the full package path. The linker dead code analysis
was not updated.
Updates #17821
Change-Id: I13fc45e0264b425d28524ec54c829e2c3e895b0b
Reviewed-on: https://go-review.googlesource.com/32916
Reviewed-by: Ian Lance Taylor <iant@golang.org>
-rw-r--r-- | src/cmd/link/internal/ld/deadcode.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/cmd/link/internal/ld/deadcode.go b/src/cmd/link/internal/ld/deadcode.go index 335d9849c9..c0c0c6bcf4 100644 --- a/src/cmd/link/internal/ld/deadcode.go +++ b/src/cmd/link/internal/ld/deadcode.go @@ -7,9 +7,7 @@ package ld import ( "cmd/internal/obj" "cmd/internal/sys" - "flag" "fmt" - "path/filepath" "strings" "unicode" ) @@ -245,9 +243,7 @@ func (d *deadcodepass) init() { if *FlagLinkshared && (Buildmode == BuildmodeExe || Buildmode == BuildmodePIE) { names = append(names, "main.main", "main.init") } else if Buildmode == BuildmodePlugin { - pluginName := strings.TrimSuffix(filepath.Base(flag.Arg(0)), ".a") - pluginInit := pluginName + ".init" - names = append(names, pluginInit, "go.plugin.tabs") + names = append(names, *flagPluginPath+".init", *flagPluginPath+".main", "go.plugin.tabs") // We don't keep the go.plugin.exports symbol, // but we do keep the symbols it refers to. |