mirror of
https://github.com/golang/go
synced 2024-11-17 09:04:44 -07:00
cmd/link: rename ELF struct fields to remove "elf" prefix
While we're here rename setupplt to setupPLT. This is a pure naming change with no semantic change. Change-Id: Ib0312fb6568475b620dab7632438b4d25e4d9cc0 Reviewed-on: https://go-review.googlesource.com/c/go/+/463744 Reviewed-by: Than McIntosh <thanm@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> Auto-Submit: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
43115ff094
commit
4bca2b9583
@ -70,9 +70,9 @@ func Init() (*sys.Arch, ld.Arch) {
|
||||
Dragonflydynld: "/usr/libexec/ld-elf.so.2",
|
||||
Solarisdynld: "/lib/amd64/ld.so.1",
|
||||
|
||||
Elfreloc1: elfreloc1,
|
||||
ElfrelocSize: 24,
|
||||
Elfsetupplt: elfsetupplt,
|
||||
Reloc1: elfreloc1,
|
||||
RelocSize: 24,
|
||||
SetupPLT: elfsetupplt,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -68,9 +68,9 @@ func Init() (*sys.Arch, ld.Arch) {
|
||||
Dragonflydynld: "XXX",
|
||||
Solarisdynld: "XXX",
|
||||
|
||||
Elfreloc1: elfreloc1,
|
||||
ElfrelocSize: 8,
|
||||
Elfsetupplt: elfsetupplt,
|
||||
Reloc1: elfreloc1,
|
||||
RelocSize: 8,
|
||||
SetupPLT: elfsetupplt,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -70,9 +70,9 @@ func Init() (*sys.Arch, ld.Arch) {
|
||||
Dragonflydynld: "XXX",
|
||||
Solarisdynld: "XXX",
|
||||
|
||||
Elfreloc1: elfreloc1,
|
||||
ElfrelocSize: 24,
|
||||
Elfsetupplt: elfsetupplt,
|
||||
Reloc1: elfreloc1,
|
||||
RelocSize: 24,
|
||||
SetupPLT: elfsetupplt,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -206,9 +206,9 @@ type ELFArch struct {
|
||||
Dragonflydynld string
|
||||
Solarisdynld string
|
||||
|
||||
Elfreloc1 func(*Link, *OutBuf, *loader.Loader, loader.Sym, loader.ExtReloc, int, int64) bool
|
||||
ElfrelocSize uint32 // size of an ELF relocation record, must match Elfreloc1.
|
||||
Elfsetupplt func(ctxt *Link, plt, gotplt *loader.SymbolBuilder, dynamic loader.Sym)
|
||||
Reloc1 func(*Link, *OutBuf, *loader.Loader, loader.Sym, loader.ExtReloc, int, int64) bool
|
||||
RelocSize uint32 // size of an ELF relocation record, must match Reloc1.
|
||||
SetupPLT func(ctxt *Link, plt, gotplt *loader.SymbolBuilder, dynamic loader.Sym)
|
||||
|
||||
// DynamicReadOnly can be set to true to make the .dynamic
|
||||
// section read-only. By default it is writable.
|
||||
@ -1289,8 +1289,8 @@ func elfrelocsect(ctxt *Link, out *OutBuf, sect *sym.Section, syms []loader.Sym)
|
||||
break
|
||||
}
|
||||
|
||||
// Compute external relocations on the go, and pass to Elfreloc1
|
||||
// to stream out.
|
||||
// Compute external relocations on the go, and pass to
|
||||
// ELF.Reloc1 to stream out.
|
||||
relocs := ldr.Relocs(s)
|
||||
for ri := 0; ri < relocs.Count(); ri++ {
|
||||
r := relocs.At(ri)
|
||||
@ -1309,7 +1309,7 @@ func elfrelocsect(ctxt *Link, out *OutBuf, sect *sym.Section, syms []loader.Sym)
|
||||
if !ldr.AttrReachable(rr.Xsym) {
|
||||
ldr.Errorf(s, "unreachable reloc %d (%s) target %v", r.Type(), sym.RelocName(ctxt.Arch, r.Type()), ldr.SymName(rr.Xsym))
|
||||
}
|
||||
if !thearch.ELF.Elfreloc1(ctxt, out, ldr, s, rr, ri, int64(uint64(ldr.SymValue(s)+int64(r.Off()))-sect.Vaddr)) {
|
||||
if !thearch.ELF.Reloc1(ctxt, out, ldr, s, rr, ri, int64(uint64(ldr.SymValue(s)+int64(r.Off()))-sect.Vaddr)) {
|
||||
ldr.Errorf(s, "unsupported obj reloc %d (%s)/%d to %s", r.Type(), sym.RelocName(ctxt.Arch, r.Type()), r.Siz(), ldr.SymName(r.Sym()))
|
||||
}
|
||||
}
|
||||
@ -1326,7 +1326,7 @@ func elfEmitReloc(ctxt *Link) {
|
||||
ctxt.Out.Write8(0)
|
||||
}
|
||||
|
||||
sizeExtRelocs(ctxt, thearch.ELF.ElfrelocSize)
|
||||
sizeExtRelocs(ctxt, thearch.ELF.RelocSize)
|
||||
relocSect, wg := relocSectFn(ctxt, elfrelocsect)
|
||||
|
||||
for _, sect := range Segtext.Sections {
|
||||
@ -1578,7 +1578,7 @@ func (ctxt *Link) doelf() {
|
||||
// S390X uses .got instead of .got.plt
|
||||
gotplt = got
|
||||
}
|
||||
thearch.ELF.Elfsetupplt(ctxt, plt, gotplt, dynamic.Sym())
|
||||
thearch.ELF.SetupPLT(ctxt, plt, gotplt, dynamic.Sym())
|
||||
|
||||
/*
|
||||
* .dynamic table
|
||||
|
@ -200,7 +200,7 @@ type Arch struct {
|
||||
// is the contents of the to-be-relocated data item (from sym.P). Return
|
||||
// value is the appropriately relocated value (to be written back to the
|
||||
// same spot in sym.P), number of external _host_ relocations needed (i.e.
|
||||
// ELF/Mach-O/etc. relocations, not Go relocations, this must match Elfreloc1,
|
||||
// ELF/Mach-O/etc. relocations, not Go relocations, this must match ELF.Reloc1,
|
||||
// etc.), and a boolean indicating success/failure (a failing value indicates
|
||||
// a fatal error).
|
||||
Archreloc func(*Target, *loader.Loader, *ArchSyms, loader.Reloc, loader.Sym,
|
||||
|
@ -36,9 +36,9 @@ func Init() (*sys.Arch, ld.Arch) {
|
||||
Dragonflydynld: "XXX",
|
||||
Solarisdynld: "XXX",
|
||||
|
||||
Elfreloc1: elfreloc1,
|
||||
ElfrelocSize: 24,
|
||||
Elfsetupplt: elfsetupplt,
|
||||
Reloc1: elfreloc1,
|
||||
RelocSize: 24,
|
||||
SetupPLT: elfsetupplt,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -69,9 +69,9 @@ func Init() (*sys.Arch, ld.Arch) {
|
||||
Dragonflydynld: "XXX",
|
||||
Solarisdynld: "XXX",
|
||||
|
||||
Elfreloc1: elfreloc1,
|
||||
ElfrelocSize: 8,
|
||||
Elfsetupplt: elfsetupplt,
|
||||
Reloc1: elfreloc1,
|
||||
RelocSize: 8,
|
||||
SetupPLT: elfsetupplt,
|
||||
|
||||
// Historically GNU ld creates a read-only
|
||||
// .dynamic section.
|
||||
|
@ -67,9 +67,9 @@ func Init() (*sys.Arch, ld.Arch) {
|
||||
Dragonflydynld: "XXX",
|
||||
Solarisdynld: "XXX",
|
||||
|
||||
Elfreloc1: elfreloc1,
|
||||
ElfrelocSize: 24,
|
||||
Elfsetupplt: elfsetupplt,
|
||||
Reloc1: elfreloc1,
|
||||
RelocSize: 24,
|
||||
SetupPLT: elfsetupplt,
|
||||
|
||||
// Historically GNU ld creates a read-only
|
||||
// .dynamic section.
|
||||
|
@ -76,9 +76,9 @@ func Init() (*sys.Arch, ld.Arch) {
|
||||
Dragonflydynld: "XXX",
|
||||
Solarisdynld: "XXX",
|
||||
|
||||
Elfreloc1: elfreloc1,
|
||||
ElfrelocSize: 24,
|
||||
Elfsetupplt: elfsetupplt,
|
||||
Reloc1: elfreloc1,
|
||||
RelocSize: 24,
|
||||
SetupPLT: elfsetupplt,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -45,9 +45,9 @@ func Init() (*sys.Arch, ld.Arch) {
|
||||
Dragonflydynld: "XXX",
|
||||
Solarisdynld: "XXX",
|
||||
|
||||
Elfreloc1: elfreloc1,
|
||||
ElfrelocSize: 24,
|
||||
Elfsetupplt: elfsetupplt,
|
||||
Reloc1: elfreloc1,
|
||||
RelocSize: 24,
|
||||
SetupPLT: elfsetupplt,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -64,9 +64,9 @@ func Init() (*sys.Arch, ld.Arch) {
|
||||
Dragonflydynld: "XXX",
|
||||
Solarisdynld: "XXX",
|
||||
|
||||
Elfreloc1: elfreloc1,
|
||||
ElfrelocSize: 24,
|
||||
Elfsetupplt: elfsetupplt,
|
||||
Reloc1: elfreloc1,
|
||||
RelocSize: 24,
|
||||
SetupPLT: elfsetupplt,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -66,9 +66,9 @@ func Init() (*sys.Arch, ld.Arch) {
|
||||
Netbsddynld: "/usr/libexec/ld.elf_so",
|
||||
Solarisdynld: "/lib/ld.so.1",
|
||||
|
||||
Elfreloc1: elfreloc1,
|
||||
ElfrelocSize: 8,
|
||||
Elfsetupplt: elfsetupplt,
|
||||
Reloc1: elfreloc1,
|
||||
RelocSize: 8,
|
||||
SetupPLT: elfsetupplt,
|
||||
},
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user