]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: remove legacy newdie function
authorThan McIntosh <thanm@google.com>
Wed, 11 Mar 2020 20:37:41 +0000 (16:37 -0400)
committerThan McIntosh <thanm@google.com>
Wed, 11 Mar 2020 22:31:11 +0000 (22:31 +0000)
Remove the linker's "newdie" function (no longer called).

Change-Id: Ide8be6019f512339b8356b0af812426f353af47d
Reviewed-on: https://go-review.googlesource.com/c/go/+/223057
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/link/internal/ld/dwarf2.go

index 172c8a049eb9112e59e848633807f6c43dbbed0b..ac971849b4debb0f1bfde024c97f7235b29c25c4 100644 (file)
 package ld
 
 import (
-       "cmd/internal/dwarf"
        "cmd/internal/objabi"
        "cmd/link/internal/sym"
-       "fmt"
        "log"
 )
 
@@ -27,34 +25,6 @@ func isDwarf64(ctxt *Link) bool {
 
 var dwarfp []*sym.Symbol
 
-// Every DIE manufactured by the linker has at least an AT_name
-// attribute (but it will only be written out if it is listed in the abbrev).
-// The compiler does create nameless DWARF DIEs (ex: concrete subprogram
-// instance).
-func newdie(ctxt *Link, parent *dwarf.DWDie, abbrev int, name string, version int) *dwarf.DWDie {
-       die := new(dwarf.DWDie)
-       die.Abbrev = abbrev
-       die.Link = parent.Child
-       parent.Child = die
-
-       newattr(die, dwarf.DW_AT_name, dwarf.DW_CLS_STRING, int64(len(name)), name)
-
-       if name != "" && (abbrev <= dwarf.DW_ABRV_VARIABLE || abbrev >= dwarf.DW_ABRV_NULLTYPE) {
-               if abbrev != dwarf.DW_ABRV_VARIABLE || version == 0 {
-                       if abbrev == dwarf.DW_ABRV_COMPUNIT {
-                               // Avoid collisions with "real" symbol names.
-                               name = fmt.Sprintf(".pkg.%s.%d", name, len(ctxt.compUnits))
-                       }
-                       s := ctxt.Syms.Lookup(dwarf.InfoPrefix+name, version)
-                       s.Attr |= sym.AttrNotInSymbolTable
-                       s.Type = sym.SDWARFINFO
-                       die.Sym = s
-               }
-       }
-
-       return die
-}
-
 /*
  *  Elf.
  */