aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/internal/ld/deadcode.go
diff options
context:
space:
mode:
authorDavid Crawshaw <crawshaw@golang.org>2017-09-30 21:10:49 +0000
committerDavid Crawshaw <crawshaw@golang.org>2017-10-03 23:32:02 +0000
commit5d95de207211a2fc6241daa7f8a0797f013850ed (patch)
tree40bdb9212a53f52530fb9c316e1d2a4b585dbd9c /src/cmd/link/internal/ld/deadcode.go
parent0a7ef31d7d3e372129a665043c9377dc9e3860ee (diff)
downloadgo-5d95de207211a2fc6241daa7f8a0797f013850ed.tar.xz
cmd/link: remove SysArch global variable
For #22095 Change-Id: I9d1f0d93f8fd701a24af826dc903eea2bc235de2 Reviewed-on: https://go-review.googlesource.com/67317 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/link/internal/ld/deadcode.go')
-rw-r--r--src/cmd/link/internal/ld/deadcode.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/link/internal/ld/deadcode.go b/src/cmd/link/internal/ld/deadcode.go
index f9ca346081..8333e6411c 100644
--- a/src/cmd/link/internal/ld/deadcode.go
+++ b/src/cmd/link/internal/ld/deadcode.go
@@ -199,7 +199,7 @@ func (d *deadcodepass) markMethod(m methodref) {
func (d *deadcodepass) init() {
var names []string
- if SysArch.Family == sys.ARM {
+ if d.ctxt.Arch.Family == sys.ARM {
// mark some functions that are only referenced after linker code editing
names = append(names, "runtime.read_tls_fallback")
}
@@ -221,7 +221,7 @@ func (d *deadcodepass) init() {
} else {
// The external linker refers main symbol directly.
if Linkmode == LinkExternal && (Buildmode == BuildmodeExe || Buildmode == BuildmodePIE) {
- if Headtype == objabi.Hwindows && SysArch.Family == sys.I386 {
+ if Headtype == objabi.Hwindows && d.ctxt.Arch.Family == sys.I386 {
*flagEntrySymbol = "_main"
} else {
*flagEntrySymbol = "main"
@@ -275,7 +275,7 @@ func (d *deadcodepass) flood() {
// later will give a better error than deadcode.
continue
}
- if decodetypeKind(s)&kindMask == kindInterface {
+ if decodetypeKind(d.ctxt.Arch, s)&kindMask == kindInterface {
for _, sig := range decodeIfaceMethods(d.ctxt.Arch, s) {
if d.ctxt.Debugvlog > 1 {
d.ctxt.Logf("reached iface method: %s\n", sig)