mirror of
https://github.com/golang/go
synced 2024-11-23 20:00:04 -07:00
cmd/link: delete more unreachable code
Debugasm can never be set in cmd/link, so delete it and the code it enables. Change-Id: If828db0b09f1a9e512dc660ac2750657a769094c Reviewed-on: https://go-review.googlesource.com/20971 Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
70ef564e79
commit
49be1ebab4
@ -166,7 +166,6 @@ type Link struct {
|
||||
Goarm int32
|
||||
Headtype int
|
||||
Arch *LinkArch
|
||||
Debugasm int32
|
||||
Debugvlog int32
|
||||
Bso *obj.Biobuf
|
||||
Windows int32
|
||||
|
@ -104,7 +104,6 @@ package ld
|
||||
import (
|
||||
"bytes"
|
||||
"cmd/internal/obj"
|
||||
"fmt"
|
||||
"log"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -317,56 +316,6 @@ overwrite:
|
||||
ctxt.Etextp = s
|
||||
}
|
||||
}
|
||||
|
||||
if ctxt.Debugasm != 0 {
|
||||
fmt.Fprintf(ctxt.Bso, "%s ", s.Name)
|
||||
if s.Version != 0 {
|
||||
fmt.Fprintf(ctxt.Bso, "v=%d ", s.Version)
|
||||
}
|
||||
if s.Type != 0 {
|
||||
fmt.Fprintf(ctxt.Bso, "t=%d ", s.Type)
|
||||
}
|
||||
if s.Attr.DuplicateOK() {
|
||||
fmt.Fprintf(ctxt.Bso, "dupok ")
|
||||
}
|
||||
if s.Attr.NoSplit() {
|
||||
fmt.Fprintf(ctxt.Bso, "nosplit ")
|
||||
}
|
||||
fmt.Fprintf(ctxt.Bso, "size=%d value=%d", int64(s.Size), int64(s.Value))
|
||||
if s.Type == obj.STEXT {
|
||||
fmt.Fprintf(ctxt.Bso, " args=%#x locals=%#x", uint64(s.Args), uint64(s.Locals))
|
||||
}
|
||||
fmt.Fprintf(ctxt.Bso, "\n")
|
||||
var c int
|
||||
var j int
|
||||
for i := 0; i < len(s.P); {
|
||||
fmt.Fprintf(ctxt.Bso, "\t%#04x", uint(i))
|
||||
for j = i; j < i+16 && j < len(s.P); j++ {
|
||||
fmt.Fprintf(ctxt.Bso, " %02x", s.P[j])
|
||||
}
|
||||
for ; j < i+16; j++ {
|
||||
fmt.Fprintf(ctxt.Bso, " ")
|
||||
}
|
||||
fmt.Fprintf(ctxt.Bso, " ")
|
||||
for j = i; j < i+16 && j < len(s.P); j++ {
|
||||
c = int(s.P[j])
|
||||
if ' ' <= c && c <= 0x7e {
|
||||
fmt.Fprintf(ctxt.Bso, "%c", c)
|
||||
} else {
|
||||
fmt.Fprintf(ctxt.Bso, ".")
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Fprintf(ctxt.Bso, "\n")
|
||||
i += 16
|
||||
}
|
||||
|
||||
var r *Reloc
|
||||
for i := 0; i < len(s.R); i++ {
|
||||
r = &s.R[i]
|
||||
fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%d\n", int(r.Off), r.Siz, r.Type, r.Sym.Name, int64(r.Add))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func readref(ctxt *Link, f *obj.Biobuf, pkg string, pn string) {
|
||||
|
Loading…
Reference in New Issue
Block a user