mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: move Iself global to ctxt
For #22095 Change-Id: Iba3dffc782cecc15ea0e90a971a2734729984945 Reviewed-on: https://go-review.googlesource.com/70834 Run-TryBot: David Crawshaw <crawshaw@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
6738c494ad
commit
d05f82a11a
15 changed files with 68 additions and 68 deletions
|
|
@ -58,7 +58,7 @@ func gentext(ctxt *ld.Link) {
|
|||
} else {
|
||||
switch ctxt.BuildMode {
|
||||
case ld.BuildModeCArchive:
|
||||
if !ld.Iself {
|
||||
if !ctxt.IsELF {
|
||||
return
|
||||
}
|
||||
case ld.BuildModePIE, ld.BuildModeCShared, ld.BuildModePlugin:
|
||||
|
|
@ -306,7 +306,7 @@ func adddynrel(ctxt *ld.Link, s *sym.Symbol, r *sym.Reloc) bool {
|
|||
if s.Type != sym.SDATA {
|
||||
break
|
||||
}
|
||||
if ld.Iself {
|
||||
if ctxt.IsELF {
|
||||
ld.Adddynsym(ctxt, targ)
|
||||
rel := ctxt.Syms.Lookup(".rel", 0)
|
||||
rel.AddAddrPlus(ctxt.Arch, s, int64(r.Off))
|
||||
|
|
@ -541,7 +541,7 @@ func addpltsym(ctxt *ld.Link, s *sym.Symbol) {
|
|||
|
||||
ld.Adddynsym(ctxt, s)
|
||||
|
||||
if ld.Iself {
|
||||
if ctxt.IsELF {
|
||||
plt := ctxt.Syms.Lookup(".plt", 0)
|
||||
got := ctxt.Syms.Lookup(".got.plt", 0)
|
||||
rel := ctxt.Syms.Lookup(".rel.plt", 0)
|
||||
|
|
@ -604,7 +604,7 @@ func addgotsym(ctxt *ld.Link, s *sym.Symbol) {
|
|||
s.Got = int32(got.Size)
|
||||
got.AddUint32(ctxt.Arch, 0)
|
||||
|
||||
if ld.Iself {
|
||||
if ctxt.IsELF {
|
||||
rel := ctxt.Syms.Lookup(".rel", 0)
|
||||
rel.AddAddrPlus(ctxt.Arch, got, int64(s.Got))
|
||||
rel.AddUint32(ctxt.Arch, ld.ELF32_R_INFO(uint32(s.Dynid), uint32(elf.R_386_GLOB_DAT)))
|
||||
|
|
@ -620,7 +620,7 @@ func asmb(ctxt *ld.Link) {
|
|||
ctxt.Logf("%5.2f asmb\n", ld.Cputime())
|
||||
}
|
||||
|
||||
if ld.Iself {
|
||||
if ctxt.IsELF {
|
||||
ld.Asmbelfsetup()
|
||||
}
|
||||
|
||||
|
|
@ -675,7 +675,7 @@ func asmb(ctxt *ld.Link) {
|
|||
}
|
||||
switch ld.Headtype {
|
||||
default:
|
||||
if ld.Iself {
|
||||
if ctxt.IsELF {
|
||||
symo = uint32(ld.Segdwarf.Fileoff + ld.Segdwarf.Filelen)
|
||||
symo = uint32(ld.Rnd(int64(symo), int64(*ld.FlagRound)))
|
||||
}
|
||||
|
|
@ -694,7 +694,7 @@ func asmb(ctxt *ld.Link) {
|
|||
ctxt.Out.SeekSet(int64(symo))
|
||||
switch ld.Headtype {
|
||||
default:
|
||||
if ld.Iself {
|
||||
if ctxt.IsELF {
|
||||
if ctxt.Debugvlog != 0 {
|
||||
ctxt.Logf("%5.2f elfsym\n", ld.Cputime())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue