From 7f872be02f9df73df64b2e6af7b00f15c440c3df Mon Sep 17 00:00:00 2001 From: Cherry Zhang Date: Thu, 14 May 2020 20:20:20 -0400 Subject: [PATCH] [dev.link] cmd/link: delete some deadcode Change-Id: Ic4ca89ced19bf91e3d3ee10b7522d7ebe6b7c7fb Reviewed-on: https://go-review.googlesource.com/c/go/+/234116 Run-TryBot: Cherry Zhang TryBot-Result: Gobot Gobot Reviewed-by: Than McIntosh Reviewed-by: Jeremy Faller --- src/cmd/link/internal/ld/dwarf.go | 21 --------------------- src/cmd/link/internal/ld/lib.go | 6 +----- src/cmd/link/internal/ld/link.go | 1 - 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/cmd/link/internal/ld/dwarf.go b/src/cmd/link/internal/ld/dwarf.go index 964ed7abf6..dc5bcd7b0e 100644 --- a/src/cmd/link/internal/ld/dwarf.go +++ b/src/cmd/link/internal/ld/dwarf.go @@ -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 diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go index 6d795cac69..2e8aefbd88 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go @@ -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) diff --git a/src/cmd/link/internal/ld/link.go b/src/cmd/link/internal/ld/link.go index 20c44eb9b3..8bb42e2ac6 100644 --- a/src/cmd/link/internal/ld/link.go +++ b/src/cmd/link/internal/ld/link.go @@ -93,7 +93,6 @@ type Link struct { // Elf symtab variables. numelfsym int // starts at 0, 1 is reserved - elfbind int } type cgodata struct { -- 2.48.1