]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/cmd/link/internal/loader/loader.go
cmd/link/internal/loader: remove some dead code
[gostls13.git] / src / cmd / link / internal / loader / loader.go
index fa74dcede423038c9ef363fa72aaa54d02b35666..5dd657b4d7fc7131a9c8bc8e0108f8654bd94d0b 100644 (file)
@@ -27,7 +27,7 @@ var _ = fmt.Print
 
 // Sym encapsulates a global symbol index, used to identify a specific
 // Go symbol. The 0-valued Sym is corresponds to an invalid symbol.
-type Sym uint32
+type Sym = sym.LoaderSym
 
 // Relocs encapsulates the set of relocations on a given symbol; an
 // instance of this type is returned by the Loader Relocs() method.
@@ -261,8 +261,6 @@ type Loader struct {
 
        strictDupMsgs int // number of strict-dup warning/errors, when FlagStrictDups is enabled
 
-       elfsetstring elfsetstringFunc
-
        errorReporter *ErrorReporter
 
        npkgsyms    int // number of package symbols, for accounting
@@ -284,8 +282,6 @@ const (
        goObjStart
 )
 
-type elfsetstringFunc func(str string, off int)
-
 // extSymPayload holds the payload (data + relocations) for linker-synthesized
 // external symbols (note that symbol value is stored in a separate slice).
 type extSymPayload struct {
@@ -304,7 +300,7 @@ const (
        FlagStrictDups = 1 << iota
 )
 
-func NewLoader(flags uint32, elfsetstring elfsetstringFunc, reporter *ErrorReporter) *Loader {
+func NewLoader(flags uint32, reporter *ErrorReporter) *Loader {
        nbuiltin := goobj.NBuiltin()
        extReader := &oReader{objidx: extObj}
        ldr := &Loader{
@@ -333,7 +329,6 @@ func NewLoader(flags uint32, elfsetstring elfsetstringFunc, reporter *ErrorRepor
                extStaticSyms:        make(map[nameVer]Sym),
                builtinSyms:          make([]Sym, nbuiltin),
                flags:                flags,
-               elfsetstring:         elfsetstring,
                errorReporter:        reporter,
                sects:                []*sym.Section{nil}, // reserve index 0 for nil section
        }
@@ -1041,7 +1036,7 @@ func (l *Loader) SetAttrCgoExportDynamic(i Sym, v bool) {
        }
 }
 
-// ForAllAttrCgoExportDynamic calls f for every symbol that has been
+// ForAllCgoExportDynamic calls f for every symbol that has been
 // marked with the "cgo_export_dynamic" compiler directive.
 func (l *Loader) ForAllCgoExportDynamic(f func(Sym)) {
        for s := range l.attrCgoExportDynamic {
@@ -1131,7 +1126,7 @@ func (l *Loader) SetAttrReadOnly(i Sym, v bool) {
 //
 // - Outer symbol covers the address ranges of its sub-symbols.
 //   Outer.Sub is set in this case.
-// - Outer symbol doesn't conver the address ranges. It is zero-sized
+// - Outer symbol doesn't cover the address ranges. It is zero-sized
 //   and doesn't have sub-symbols. In the case, the inner symbol is
 //   not actually a "SubSymbol". (Tricky!)
 //
@@ -1321,14 +1316,6 @@ func (l *Loader) SetSymSect(i Sym, sect *sym.Section) {
        l.symSects[i] = sect.Index
 }
 
-// growSects grows the slice used to store symbol sections.
-func (l *Loader) growSects(reqLen int) {
-       curLen := len(l.symSects)
-       if reqLen > curLen {
-               l.symSects = append(l.symSects, make([]uint16, reqLen+1-curLen)...)
-       }
-}
-
 // NewSection creates a new (output) section.
 func (l *Loader) NewSection() *sym.Section {
        sect := new(sym.Section)