]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: delete more unreachable code
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Mon, 21 Mar 2016 06:32:57 +0000 (19:32 +1300)
committerMichael Hudson-Doyle <michael.hudson@canonical.com>
Mon, 21 Mar 2016 06:56:51 +0000 (06:56 +0000)
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>

src/cmd/link/internal/ld/link.go
src/cmd/link/internal/ld/objfile.go

index 9a96acc1309061e5bda1bf799455ebbb657633dd..1b042ba1dcffc76bd1006b1a8a5cab8ba639d1cf 100644 (file)
@@ -166,7 +166,6 @@ type Link struct {
        Goarm     int32
        Headtype  int
        Arch      *LinkArch
-       Debugasm  int32
        Debugvlog int32
        Bso       *obj.Biobuf
        Windows   int32
index 6bf3d73a41473afcf43e5ad0e49a8ab1266e2264..a049fcfe4a24c5860ed33893424cd9da371308a1 100644 (file)
@@ -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) {