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

@ -95,16 +95,16 @@ type Arch struct {
Openbsddynld string
Dragonflydynld string
Solarisdynld string
Adddynrel func(*Symbol, *Reloc)
Archinit func()
Archreloc func(*Reloc, *Symbol, *int64) int
Archrelocvariant func(*Reloc, *Symbol, int64) int64
Adddynrel func(*Link, *Symbol, *Reloc)
Archinit func(*Link)
Archreloc func(*Link, *Reloc, *Symbol, *int64) int
Archrelocvariant func(*Link, *Reloc, *Symbol, int64) int64
Asmb func(*Link)
Elfreloc1 func(*Reloc, int64) int
Elfsetupplt func()
Gentext func()
Machoreloc1 func(*Reloc, int64) int
PEreloc1 func(*Reloc, int64) bool
Elfreloc1 func(*Link, *Reloc, int64) int
Elfsetupplt func(*Link)
Gentext func(*Link)
Machoreloc1 func(*Link, *Reloc, int64) int
PEreloc1 func(*Link, *Reloc, int64) bool
Wput func(uint16)
Lput func(uint32)
Vput func(uint64)
@ -209,8 +209,7 @@ var (
extldflags string
extar string
libgccfile string
debug_s int // backup old value of debug['s']
Ctxt *Link // Global pointer to ctxt used by arch-specific packages
debug_s int // backup old value of debug['s']
HEADR int32
HEADTYPE int32
INITRND int32