mirror of
https://github.com/golang/go.git
synced 2025-05-29 11:25:43 +00:00
cmd/link: remove some dead code
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>
This commit is contained in:
parent
9c514e149c
commit
e92d0d82e0
@ -42,8 +42,6 @@ func PADDR(x uint32) uint32 {
|
|||||||
return x &^ 0x80000000
|
return x &^ 0x80000000
|
||||||
}
|
}
|
||||||
|
|
||||||
var zeroes string
|
|
||||||
|
|
||||||
func Addcall(ctxt *ld.Link, s *ld.LSym, t *ld.LSym) int64 {
|
func Addcall(ctxt *ld.Link, s *ld.LSym, t *ld.LSym) int64 {
|
||||||
s.Reachable = true
|
s.Reachable = true
|
||||||
i := s.Size
|
i := s.Size
|
||||||
|
@ -64,9 +64,6 @@ package arm
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
thechar = '5'
|
thechar = '5'
|
||||||
PtrSize = 4
|
|
||||||
IntSize = 4
|
|
||||||
RegSize = 4
|
|
||||||
MaxAlign = 8 // max data alignment
|
MaxAlign = 8 // max data alignment
|
||||||
FuncAlign = 4 // single-instruction alignment
|
FuncAlign = 4 // single-instruction alignment
|
||||||
MINLC = 4
|
MINLC = 4
|
||||||
|
@ -63,9 +63,6 @@ package arm64
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
thechar = '7'
|
thechar = '7'
|
||||||
PtrSize = 8
|
|
||||||
IntSize = 8
|
|
||||||
RegSize = 8
|
|
||||||
MaxAlign = 32 // max data alignment
|
MaxAlign = 32 // max data alignment
|
||||||
FuncAlign = 8
|
FuncAlign = 8
|
||||||
MINLC = 4
|
MINLC = 4
|
||||||
|
@ -32,13 +32,11 @@ package ld
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
SARMAG = 8
|
SARMAG = 8
|
||||||
SARNAME = 16
|
|
||||||
SAR_HDR = 16 + 44
|
SAR_HDR = 16 + 44
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ARMAG = "!<arch>\n"
|
ARMAG = "!<arch>\n"
|
||||||
ARFMAG = "`\n"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ArHdr struct {
|
type ArHdr struct {
|
||||||
|
@ -142,7 +142,6 @@ var (
|
|||||||
// use in debuggers and such.
|
// use in debuggers and such.
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MAXIO = 8192
|
|
||||||
MINFUNC = 16 // minimum size for a function
|
MINFUNC = 16 // minimum size for a function
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -241,12 +240,6 @@ var coutbuf struct {
|
|||||||
f *os.File
|
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 (
|
const (
|
||||||
symname = "__.GOSYMDEF"
|
symname = "__.GOSYMDEF"
|
||||||
pkgname = "__.PKGDEF"
|
pkgname = "__.PKGDEF"
|
||||||
@ -965,10 +958,6 @@ func hostlink() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if Iself && AssumeGoldLinker != 0 /*TypeKind(100016)*/ {
|
|
||||||
argv = append(argv, "-Wl,--rosegment")
|
|
||||||
}
|
|
||||||
|
|
||||||
switch Buildmode {
|
switch Buildmode {
|
||||||
case BuildmodeExe:
|
case BuildmodeExe:
|
||||||
if HEADTYPE == obj.Hdarwin {
|
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])
|
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 {
|
type Chain struct {
|
||||||
sym *LSym
|
sym *LSym
|
||||||
up *Chain
|
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() {
|
func Cflush() {
|
||||||
if err := coutbuf.Writer.Flush(); err != nil {
|
if err := coutbuf.Writer.Flush(); err != nil {
|
||||||
Exitf("flushing %s: %v", coutbuf.f.Name(), err)
|
Exitf("flushing %s: %v", coutbuf.f.Name(), err)
|
||||||
|
@ -209,10 +209,6 @@ const (
|
|||||||
RV_TYPE_MASK = RV_CHECK_OVERFLOW - 1
|
RV_TYPE_MASK = RV_CHECK_OVERFLOW - 1
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
LINKHASH = 100003
|
|
||||||
)
|
|
||||||
|
|
||||||
// Pcdata iterator.
|
// Pcdata iterator.
|
||||||
// for(pciterinit(ctxt, &it, &pcd); !it.done; pciternext(&it)) { it.value holds in [it.pc, it.nextpc) }
|
// for(pciterinit(ctxt, &it, &pcd); !it.done; pciternext(&it)) { it.value holds in [it.pc, it.nextpc) }
|
||||||
|
|
||||||
|
@ -39,10 +39,6 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
func yy_isalpha(c int) bool {
|
|
||||||
return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z'
|
|
||||||
}
|
|
||||||
|
|
||||||
var headers = []struct {
|
var headers = []struct {
|
||||||
name string
|
name string
|
||||||
val int
|
val int
|
||||||
|
@ -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
|
|
||||||
)
|
|
@ -67,24 +67,6 @@ func tokenize(s string) []string {
|
|||||||
return f
|
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.
|
// strings.Compare, introduced in Go 1.5.
|
||||||
func stringsCompare(a, b string) int {
|
func stringsCompare(a, b string) int {
|
||||||
if a == b {
|
if a == b {
|
||||||
|
@ -63,9 +63,6 @@ package ppc64
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
thechar = '9'
|
thechar = '9'
|
||||||
PtrSize = 8
|
|
||||||
IntSize = 8
|
|
||||||
RegSize = 8
|
|
||||||
MaxAlign = 32 // max data alignment
|
MaxAlign = 32 // max data alignment
|
||||||
FuncAlign = 8
|
FuncAlign = 8
|
||||||
MINLC = 4
|
MINLC = 4
|
||||||
|
@ -33,8 +33,6 @@ package x86
|
|||||||
const (
|
const (
|
||||||
thechar = '8'
|
thechar = '8'
|
||||||
PtrSize = 4
|
PtrSize = 4
|
||||||
IntSize = 4
|
|
||||||
RegSize = 4
|
|
||||||
MaxAlign = 32 // max data alignment
|
MaxAlign = 32 // max data alignment
|
||||||
FuncAlign = 16
|
FuncAlign = 16
|
||||||
MINLC = 1
|
MINLC = 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user