diff --git a/src/cmd/link/internal/ld/dwarf.go b/src/cmd/link/internal/ld/dwarf.go index 36e11cc0d2..19db1b5573 100644 --- a/src/cmd/link/internal/ld/dwarf.go +++ b/src/cmd/link/internal/ld/dwarf.go @@ -1513,16 +1513,6 @@ const ( COMPUNITHEADERSIZE = 4 + 2 + 4 + 1 ) -// appendSyms appends the syms from 'src' into 'syms' and returns the -// result. This can go away once we do away with sym.LoaderSym -// entirely. -func appendSyms(syms []loader.Sym, src []sym.LoaderSym) []loader.Sym { - for _, s := range src { - syms = append(syms, loader.Sym(s)) - } - return syms -} - func (d *dwctxt) writeUnitInfo(u *sym.CompilationUnit, abbrevsym loader.Sym, infoEpilog loader.Sym) []loader.Sym { syms := []loader.Sym{} if len(u.Textp) == 0 && u.DWInfo.Child == nil && len(u.VarDIEs) == 0 { @@ -1551,12 +1541,12 @@ func (d *dwctxt) writeUnitInfo(u *sym.CompilationUnit, abbrevsym loader.Sym, inf // This is an under-estimate; more will be needed for type DIEs. cu := make([]loader.Sym, 0, len(u.AbsFnDIEs)+len(u.FuncDIEs)) cu = append(cu, s) - cu = appendSyms(cu, u.AbsFnDIEs) - cu = appendSyms(cu, u.FuncDIEs) + cu = append(cu, u.AbsFnDIEs...) + cu = append(cu, u.FuncDIEs...) if u.Consts != 0 { cu = append(cu, loader.Sym(u.Consts)) } - cu = appendSyms(cu, u.VarDIEs) + cu = append(cu, u.VarDIEs...) var cusize int64 for _, child := range cu { cusize += int64(len(d.ldr.Data(child))) diff --git a/src/cmd/link/internal/loader/loader.go b/src/cmd/link/internal/loader/loader.go index 4d0b497d8e..617c6ba65a 100644 --- a/src/cmd/link/internal/loader/loader.go +++ b/src/cmd/link/internal/loader/loader.go @@ -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. diff --git a/src/cmd/link/internal/sym/compilation_unit.go b/src/cmd/link/internal/sym/compilation_unit.go index 3bad5bf3f4..3d6cc3cf93 100644 --- a/src/cmd/link/internal/sym/compilation_unit.go +++ b/src/cmd/link/internal/sym/compilation_unit.go @@ -8,7 +8,7 @@ import "cmd/internal/dwarf" // LoaderSym holds a loader.Sym value. We can't refer to this // type from the sym package since loader imports sym. -type LoaderSym int +type LoaderSym uint32 // A CompilationUnit represents a set of source files that are compiled // together. Since all Go sources in a Go package are compiled together,