]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: remove some dead code
authorMichael Hudson-Doyle <michael.hudson@canonical.com>
Tue, 1 Sep 2015 00:26:42 +0000 (12:26 +1200)
committerIan Lance Taylor <iant@golang.org>
Tue, 1 Sep 2015 16:28:49 +0000 (16:28 +0000)
Change-Id: I125a12a2cb7e792f357e4d841f55c0bed2971dce
Reviewed-on: https://go-review.googlesource.com/14140
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/cmd/link/internal/amd64/asm.go
src/cmd/link/internal/arm/l.go
src/cmd/link/internal/arm64/l.go
src/cmd/link/internal/ld/ar.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/link.go
src/cmd/link/internal/ld/sym.go
src/cmd/link/internal/ld/textflag.go [deleted file]
src/cmd/link/internal/ld/util.go
src/cmd/link/internal/ppc64/l.go
src/cmd/link/internal/x86/l.go

index 3e316e64e4a09aee83577787a8fe677d39a1de5a..51765a1847faae27c507fc67e0440f7097336298 100644 (file)
@@ -42,8 +42,6 @@ func PADDR(x uint32) uint32 {
        return x &^ 0x80000000
 }
 
-var zeroes string
-
 func Addcall(ctxt *ld.Link, s *ld.LSym, t *ld.LSym) int64 {
        s.Reachable = true
        i := s.Size
index 4973772163f655b72df2fdf7f80d1b3cd846a7fe..b6de5a0cc16547cd89759b05cc9123ae94d4a277 100644 (file)
@@ -64,9 +64,6 @@ package arm
 
 const (
        thechar   = '5'
-       PtrSize   = 4
-       IntSize   = 4
-       RegSize   = 4
        MaxAlign  = 8 // max data alignment
        FuncAlign = 4 // single-instruction alignment
        MINLC     = 4
index 8d0d57e72a65027fc94d06fcfa7626ceba7f0ba9..62703d2b7d9cb22e0d5b459be4b44bed1895c181 100644 (file)
@@ -63,9 +63,6 @@ package arm64
 
 const (
        thechar   = '7'
-       PtrSize   = 8
-       IntSize   = 8
-       RegSize   = 8
        MaxAlign  = 32 // max data alignment
        FuncAlign = 8
        MINLC     = 4
index 0e59016edbab9085da48c2ecf8efa3554d353324..a596e9a9697fc23a68c4d8aaf2cd4fdaedff359b 100644 (file)
@@ -32,13 +32,11 @@ package ld
 
 const (
        SARMAG  = 8
-       SARNAME = 16
        SAR_HDR = 16 + 44
 )
 
 const (
-       ARMAG  = "!<arch>\n"
-       ARFMAG = "`\n"
+       ARMAG = "!<arch>\n"
 )
 
 type ArHdr struct {
index f31070f41bbadde29693248e07965fbc2b0ba77a..66f0a514a4e18e76bf711d4fa643730e244c7814 100644 (file)
@@ -142,7 +142,6 @@ var (
 // use in debuggers and such.
 
 const (
-       MAXIO   = 8192
        MINFUNC = 16 // minimum size for a function
 )
 
@@ -241,12 +240,6 @@ var coutbuf struct {
        f *os.File
 }
 
-const (
-       // Whether to assume that the external linker is "gold"
-       // (http://sourceware.org/ml/binutils/2008-03/msg00162.html).
-       AssumeGoldLinker = 0
-)
-
 const (
        symname = "__.GOSYMDEF"
        pkgname = "__.PKGDEF"
@@ -965,10 +958,6 @@ func hostlink() {
                }
        }
 
-       if Iself && AssumeGoldLinker != 0 /*TypeKind(100016)*/ {
-               argv = append(argv, "-Wl,--rosegment")
-       }
-
        switch Buildmode {
        case BuildmodeExe:
                if HEADTYPE == obj.Hdarwin {
@@ -1473,10 +1462,6 @@ func Be32(b []byte) uint32 {
        return uint32(b[0])<<24 | uint32(b[1])<<16 | uint32(b[2])<<8 | uint32(b[3])
 }
 
-func Be64(b []byte) uint64 {
-       return uint64(Be32(b))<<32 | uint64(Be32(b[4:]))
-}
-
 type Chain struct {
        sym   *LSym
        up    *Chain
@@ -1688,33 +1673,6 @@ func stkprint(ch *Chain, limit int) {
        }
 }
 
-func Yconv(s *LSym) string {
-       var fp string
-
-       if s == nil {
-               fp += fmt.Sprintf("<nil>")
-       } else {
-               fmt_ := ""
-               fmt_ += fmt.Sprintf("%s @0x%08x [%d]", s.Name, int64(s.Value), int64(s.Size))
-               for i := 0; int64(i) < s.Size; i++ {
-                       if i%8 == 0 {
-                               fmt_ += fmt.Sprintf("\n\t0x%04x ", i)
-                       }
-                       fmt_ += fmt.Sprintf("%02x ", s.P[i])
-               }
-
-               fmt_ += fmt.Sprintf("\n")
-               for i := 0; i < len(s.R); i++ {
-                       fmt_ += fmt.Sprintf("\t0x%04x[%x] %d %s[%x]\n", s.R[i].Off, s.R[i].Siz, s.R[i].Type, s.R[i].Sym.Name, int64(s.R[i].Add))
-               }
-
-               str := fmt_
-               fp += str
-       }
-
-       return fp
-}
-
 func Cflush() {
        if err := coutbuf.Writer.Flush(); err != nil {
                Exitf("flushing %s: %v", coutbuf.f.Name(), err)
index 54154340e04759608a556bcd06d0bb550e6b1c91..7a2c1fa296a28571cdaa4fa33f81932302d218b2 100644 (file)
@@ -209,10 +209,6 @@ const (
        RV_TYPE_MASK      = RV_CHECK_OVERFLOW - 1
 )
 
-const (
-       LINKHASH = 100003
-)
-
 // Pcdata iterator.
 //     for(pciterinit(ctxt, &it, &pcd); !it.done; pciternext(&it)) { it.value holds in [it.pc, it.nextpc) }
 
index 652109d3e370cd322d482c63ec7af0b67a22809e..e1b2f958aafa4f656ecdb8514b1672650326bbdc 100644 (file)
@@ -39,10 +39,6 @@ import (
        "strconv"
 )
 
-func yy_isalpha(c int) bool {
-       return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z'
-}
-
 var headers = []struct {
        name string
        val  int
diff --git a/src/cmd/link/internal/ld/textflag.go b/src/cmd/link/internal/ld/textflag.go
deleted file mode 100644 (file)
index 6457fda..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2013 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package ld
-
-// This file defines flags attached to various functions
-// and data objects.  The compilers, assemblers, and linker must
-// all agree on these values.
-
-const (
-       // Don't profile the marked routine.
-       //
-       // Deprecated: Not implemented, do not use.
-       NOPROF = 1
-       // It is ok for the linker to get multiple of these symbols.  It will
-       // pick one of the duplicates to use.
-       DUPOK = 2
-       // Don't insert stack check preamble.
-       NOSPLIT = 4
-       // Put this data in a read-only section.
-       RODATA = 8
-       // This data contains no pointers.
-       NOPTR = 16
-       // This is a wrapper function and should not count as disabling 'recover'.
-       WRAPPER = 32
-       // This function uses its incoming context register.
-       NEEDCTXT = 64
-)
index f38f05ce9d4064a38d0d19bdbf9f58b2cced7eca..2995e7f052539f770c4fc9cb8ce20beb04c22721 100644 (file)
@@ -67,24 +67,6 @@ func tokenize(s string) []string {
        return f
 }
 
-func cutStringAtNUL(s string) string {
-       if i := strings.Index(s, "\x00"); i >= 0 {
-               s = s[:i]
-       }
-       return s
-}
-
-func Access(name string, mode int) int {
-       if mode != 0 {
-               panic("bad access")
-       }
-       _, err := os.Stat(name)
-       if err != nil {
-               return -1
-       }
-       return 0
-}
-
 // strings.Compare, introduced in Go 1.5.
 func stringsCompare(a, b string) int {
        if a == b {
index 1275a34dbb3d2b0a1fed4a9bed438a70d1e5a6ad..1c4a4a9c862d54f2040cce2c2e16a89551c956c3 100644 (file)
@@ -63,9 +63,6 @@ package ppc64
 
 const (
        thechar   = '9'
-       PtrSize   = 8
-       IntSize   = 8
-       RegSize   = 8
        MaxAlign  = 32 // max data alignment
        FuncAlign = 8
        MINLC     = 4
index 8a811ff0a2ac9722f01485ba729ddd487babc8aa..c067425ba504f4ab8d9e052e54fcbd820d67143f 100644 (file)
@@ -33,8 +33,6 @@ package x86
 const (
        thechar   = '8'
        PtrSize   = 4
-       IntSize   = 4
-       RegSize   = 4
        MaxAlign  = 32 // max data alignment
        FuncAlign = 16
        MINLC     = 1