]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: delete some deadcode
authorCherry Zhang <cherryyz@google.com>
Fri, 15 May 2020 00:20:20 +0000 (20:20 -0400)
committerCherry Zhang <cherryyz@google.com>
Mon, 18 May 2020 15:06:22 +0000 (15:06 +0000)
Change-Id: Ic4ca89ced19bf91e3d3ee10b7522d7ebe6b7c7fb
Reviewed-on: https://go-review.googlesource.com/c/go/+/234116
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
src/cmd/link/internal/ld/dwarf.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/link.go

index 964ed7abf65392ddd0e49aaadaf925ce18ee0996..dc5bcd7b0e23a34467ef60220ff336f62d10d6f8 100644 (file)
@@ -349,9 +349,6 @@ func findchild(die *dwarf.DWDie, name string) *dwarf.DWDie {
        return nil
 }
 
-// Used to avoid string allocation when looking up dwarf symbols
-var prefixBuf = []byte(dwarf.InfoPrefix)
-
 // find looks up the loader symbol for the DWARF DIE generated for the
 // type with the specified name.
 func (d *dwctxt2) find(name string) loader.Sym {
@@ -1157,10 +1154,6 @@ func expandFile(fname string) string {
        return expandGoroot(fname)
 }
 
-func expandFileSym(l *loader.Loader, fsym loader.Sym) string {
-       return expandFile(l.SymName(fsym))
-}
-
 func (d *dwctxt2) writelines(unit *sym.CompilationUnit, ls loader.Sym) {
 
        is_stmt := uint8(1) // initially = recommended default_is_stmt = 1, tracks is_stmt toggles.
@@ -2105,20 +2098,6 @@ func (d *dwctxt2) collectlocs(units []*sym.CompilationUnit) dwarfSecInfo {
        return dwarfSecInfo{syms: append([]loader.Sym{locsym}, syms...)}
 }
 
-/*
- *  Elf.
- */
-func (d *dwctxt2) dwarfaddshstrings(ctxt *Link, shstrtab loader.Sym) {
-       panic("not yet implemented")
-}
-
-// dwarfcompress compresses the DWARF sections. Relocations are applied
-// on the fly. After this, dwarfp will contain a different (new) set of
-// symbols, and sections may have been replaced.
-func (d *dwctxt2) dwarfcompress(ctxt *Link) {
-       panic("not yet implemented")
-}
-
 // getPkgFromCUSym returns the package name for the compilation unit
 // represented by s.
 // The prefix dwarf.InfoPrefix+".pkg." needs to be removed in order to get
index 6d795cac69a2b95ae2da68ac90b46779f2a75a25..2e8aefbd88e1b04d1f4aa2a2a0a2daf1135b7eca 100644 (file)
@@ -121,9 +121,6 @@ type ArchSyms struct {
        DynStr2  loader.Sym
 }
 
-const BeforeLoadlibFull = 1
-const AfterLoadlibFull = 2
-
 // mkArchSym is a helper for setArchSyms, to set up a special symbol.
 func (ctxt *Link) mkArchSym(name string, ver int, ls *loader.Sym) {
        *ls = ctxt.loader.LookupOrCreateSym(name, ver)
@@ -136,8 +133,7 @@ func (ctxt *Link) mkArchSymVec(name string, ver int, ls []loader.Sym) {
 }
 
 // setArchSyms sets up the ArchSyms structure, and must be called before
-// relocations are applied. This function is invoked twice, once prior
-// to loadlibfull(), and once after the work of loadlibfull is complete.
+// relocations are applied.
 func (ctxt *Link) setArchSyms() {
        ctxt.mkArchSym(".got", 0, &ctxt.GOT2)
        ctxt.mkArchSym(".plt", 0, &ctxt.PLT2)
index 20c44eb9b3b99503a4694e7a14f0577cf50a5ff9..8bb42e2ac63645d2db50fdcfd748362ef070d846 100644 (file)
@@ -93,7 +93,6 @@ type Link struct {
 
        // Elf symtab variables.
        numelfsym int // starts at 0, 1 is reserved
-       elfbind   int
 }
 
 type cgodata struct {