[dev.link] cmd/link: delete sym.Symbol and sym.Reloc

This deletes all sym.Symbol and sym.Reloc references. This is
certainly not complete, and there are more cleanups to do. But I
feel this makes a good first round.

Change-Id: I7621d016957f7ef114be5f0606fcb3ad6aee71c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/234097
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-05-14 16:05:29 -04:00
parent 4e03dac77c
commit b97212d1f1
18 changed files with 34 additions and 1515 deletions

View file

@ -9,7 +9,6 @@ import (
"cmd/internal/objabi"
"cmd/internal/sys"
"cmd/link/internal/sym"
"fmt"
"sort"
)
@ -26,9 +25,6 @@ type SymbolBuilder struct {
func (l *Loader) MakeSymbolBuilder(name string) *SymbolBuilder {
// for now assume that any new sym is intended to be static
symIdx := l.CreateStaticSym(name)
if l.Syms[symIdx] != nil {
panic("can't build if sym.Symbol already present")
}
sb := &SymbolBuilder{l: l, symIdx: symIdx}
sb.extSymPayload = l.getPayload(symIdx)
return sb
@ -47,14 +43,6 @@ func (l *Loader) MakeSymbolUpdater(symIdx Sym) *SymbolBuilder {
// Create a clone with the same name/version/kind etc.
l.cloneToExternal(symIdx)
}
// Now that we're doing phase 2 DWARF generation using the loader
// but before the wavefront has reached dodata(), we can't have this
// assertion here. Commented out for now.
if false {
if l.Syms[symIdx] != nil {
panic(fmt.Sprintf("can't build if sym.Symbol %q already present", l.RawSymName(symIdx)))
}
}
// Construct updater and return.
sb := &SymbolBuilder{l: l, symIdx: symIdx}