diff --git a/src/cmd/link/internal/ld/deadcode2.go b/src/cmd/link/internal/ld/deadcode2.go index a138bc97fad..cb6bb05492e 100644 --- a/src/cmd/link/internal/ld/deadcode2.go +++ b/src/cmd/link/internal/ld/deadcode2.go @@ -18,10 +18,6 @@ import ( var _ = fmt.Print -// TODO: -// - Debug output: -// Emit messages about which symbols are kept or deleted. - type workQueue []loader.Sym // Implement container/heap.Interface. @@ -205,6 +201,16 @@ func (d *deadcodePass2) mark(symIdx, parent loader.Sym) { if d.ctxt.Reachparent != nil { d.ldr.Reachparent[symIdx] = parent } + if *flagDumpDep { + to := d.ldr.SymName(symIdx) + if to != "" { + from := "_" + if parent != 0 { + from = d.ldr.SymName(parent) + } + fmt.Printf("%s -> %s\n", from, to) + } + } } }