cmd/link/internal: remove global Ctxt variable

This change threads the *ld.Link Ctxt variable through
code in arch-specific packages. This removes all remaining
uses of Ctxt, so remove the global variable too.

This CL continues the work in golang.org/cl/27408

Updates #16818

Change-Id: I5f4536847a1825fd0b944824e8ae4e122ec0fb78
Reviewed-on: https://go-review.googlesource.com/27459
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Michael Matloob 2016-08-21 13:52:23 -04:00
parent e2b30e9000
commit 4338e5a891
20 changed files with 511 additions and 521 deletions

View file

@ -399,7 +399,7 @@ func relocsym(ctxt *Link, s *Symbol) {
case 8:
o = int64(ctxt.Arch.ByteOrder.Uint64(s.P[off:]))
}
if Thearch.Archreloc(r, s, &o) < 0 {
if Thearch.Archreloc(ctxt, r, s, &o) < 0 {
ctxt.Diag("unknown reloc %d", r.Type)
}
@ -604,7 +604,7 @@ func relocsym(ctxt *Link, s *Symbol) {
}
if r.Variant != RV_NONE {
o = Thearch.Archrelocvariant(r, s, o)
o = Thearch.Archrelocvariant(ctxt, r, s, o)
}
if false {
@ -717,7 +717,7 @@ func dynrelocsym(ctxt *Link, s *Symbol) {
if r.Sym != nil && !r.Sym.Attr.Reachable() {
ctxt.Diag("internal inconsistency: dynamic symbol %s is not reachable.", r.Sym.Name)
}
Thearch.Adddynrel(s, r)
Thearch.Adddynrel(ctxt, s, r)
}
}
}