[dev.link] cmd/link: clean up unused function and arguments

Change-Id: Idacb027c5ae11e029ee4ab10f6c9a76ff435e5b7
Reviewed-on: https://go-review.googlesource.com/c/go/+/219228
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
This commit is contained in:
Cherry Zhang 2020-02-12 17:50:21 -05:00
parent b0275bfbf4
commit 5a8b1509dd
2 changed files with 6 additions and 14 deletions

View file

@ -1476,7 +1476,7 @@ func (x RelocByOff) Less(i, j int) bool { return x[i].Off < x[j].Off }
// Preload a package: add autolibs, add defined package symbols to the symbol table.
// Does not add non-package symbols yet, which will be done in LoadNonpkgSyms.
// Does not read symbol data.
func (l *Loader) Preload(arch *sys.Arch, syms *sym.Symbols, f *bio.Reader, lib *sym.Library, unit *sym.CompilationUnit, length int64, pn string, flags int) {
func (l *Loader) Preload(syms *sym.Symbols, f *bio.Reader, lib *sym.Library, unit *sym.CompilationUnit, length int64, flags int) {
roObject, readonly, err := f.Slice(uint64(length))
if err != nil {
log.Fatal("cannot read object file:", err)
@ -1554,16 +1554,16 @@ func (l *Loader) preloadSyms(r *oReader, kind int) {
// Add non-package symbols and references to external symbols (which are always
// named).
func (l *Loader) LoadNonpkgSyms(arch *sys.Arch, syms *sym.Symbols) {
func (l *Loader) LoadNonpkgSyms(syms *sym.Symbols) {
for _, o := range l.objs[1:] {
l.preloadSyms(o.r, nonPkgDef)
}
for _, o := range l.objs[1:] {
loadObjRefs(l, o.r, arch, syms)
loadObjRefs(l, o.r, syms)
}
}
func loadObjRefs(l *Loader, r *oReader, arch *sys.Arch, syms *sym.Symbols) {
func loadObjRefs(l *Loader, r *oReader, syms *sym.Symbols) {
ndef := r.NSym() + r.NNonpkgdef()
for i, n := 0, r.NNonpkgref(); i < n; i++ {
osym := goobj2.Sym{}
@ -1834,14 +1834,6 @@ type funcAllocInfo struct {
fdOff uint32 // number of int64's needed in all Funcdataoff slices
}
// LookupOrCreate looks up a symbol by name, and creates one if not found.
// Either way, it will also create a sym.Symbol for it, if not already.
// This should only be called when interacting with parts of the linker
// that still works on sym.Symbols (i.e. internal cgo linking, for now).
func (l *Loader) LookupOrCreate(name string, version int) *sym.Symbol {
panic("unreachable") // TODO: delete once PE loader is converted
}
// cloneToExternal takes the existing object file symbol (symIdx)
// and creates a new external symbol payload that is a clone with
// respect to name, version, type, relocations, etc. The idea here