Skip to content

Commit e92d0d8

Browse files
mwhudsonianlancetaylor
authored andcommitted
cmd/link: remove some dead code
Change-Id: I125a12a2cb7e792f357e4d841f55c0bed2971dce Reviewed-on: https://go-review.googlesource.com/14140 Run-TryBot: Michael Hudson-Doyle <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: David Crawshaw <[email protected]>
1 parent 9c514e1 commit e92d0d8

File tree

11 files changed

+1
-113
lines changed

11 files changed

+1
-113
lines changed

src/cmd/link/internal/amd64/asm.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ func PADDR(x uint32) uint32 {
4242
return x &^ 0x80000000
4343
}
4444

45-
var zeroes string
46-
4745
func Addcall(ctxt *ld.Link, s *ld.LSym, t *ld.LSym) int64 {
4846
s.Reachable = true
4947
i := s.Size

src/cmd/link/internal/arm/l.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ package arm
6464

6565
const (
6666
thechar = '5'
67-
PtrSize = 4
68-
IntSize = 4
69-
RegSize = 4
7067
MaxAlign = 8 // max data alignment
7168
FuncAlign = 4 // single-instruction alignment
7269
MINLC = 4

src/cmd/link/internal/arm64/l.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ package arm64
6363

6464
const (
6565
thechar = '7'
66-
PtrSize = 8
67-
IntSize = 8
68-
RegSize = 8
6966
MaxAlign = 32 // max data alignment
7067
FuncAlign = 8
7168
MINLC = 4

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@ package ld
3232

3333
const (
3434
SARMAG = 8
35-
SARNAME = 16
3635
SAR_HDR = 16 + 44
3736
)
3837

3938
const (
40-
ARMAG = "!<arch>\n"
41-
ARFMAG = "`\n"
39+
ARMAG = "!<arch>\n"
4240
)
4341

4442
type ArHdr struct {

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

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ var (
142142
// use in debuggers and such.
143143

144144
const (
145-
MAXIO = 8192
146145
MINFUNC = 16 // minimum size for a function
147146
)
148147

@@ -241,12 +240,6 @@ var coutbuf struct {
241240
f *os.File
242241
}
243242

244-
const (
245-
// Whether to assume that the external linker is "gold"
246-
// (http://sourceware.org/ml/binutils/2008-03/msg00162.html).
247-
AssumeGoldLinker = 0
248-
)
249-
250243
const (
251244
symname = "__.GOSYMDEF"
252245
pkgname = "__.PKGDEF"
@@ -965,10 +958,6 @@ func hostlink() {
965958
}
966959
}
967960

968-
if Iself && AssumeGoldLinker != 0 /*TypeKind(100016)*/ {
969-
argv = append(argv, "-Wl,--rosegment")
970-
}
971-
972961
switch Buildmode {
973962
case BuildmodeExe:
974963
if HEADTYPE == obj.Hdarwin {
@@ -1473,10 +1462,6 @@ func Be32(b []byte) uint32 {
14731462
return uint32(b[0])<<24 | uint32(b[1])<<16 | uint32(b[2])<<8 | uint32(b[3])
14741463
}
14751464

1476-
func Be64(b []byte) uint64 {
1477-
return uint64(Be32(b))<<32 | uint64(Be32(b[4:]))
1478-
}
1479-
14801465
type Chain struct {
14811466
sym *LSym
14821467
up *Chain
@@ -1688,33 +1673,6 @@ func stkprint(ch *Chain, limit int) {
16881673
}
16891674
}
16901675

1691-
func Yconv(s *LSym) string {
1692-
var fp string
1693-
1694-
if s == nil {
1695-
fp += fmt.Sprintf("<nil>")
1696-
} else {
1697-
fmt_ := ""
1698-
fmt_ += fmt.Sprintf("%s @0x%08x [%d]", s.Name, int64(s.Value), int64(s.Size))
1699-
for i := 0; int64(i) < s.Size; i++ {
1700-
if i%8 == 0 {
1701-
fmt_ += fmt.Sprintf("\n\t0x%04x ", i)
1702-
}
1703-
fmt_ += fmt.Sprintf("%02x ", s.P[i])
1704-
}
1705-
1706-
fmt_ += fmt.Sprintf("\n")
1707-
for i := 0; i < len(s.R); i++ {
1708-
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))
1709-
}
1710-
1711-
str := fmt_
1712-
fp += str
1713-
}
1714-
1715-
return fp
1716-
}
1717-
17181676
func Cflush() {
17191677
if err := coutbuf.Writer.Flush(); err != nil {
17201678
Exitf("flushing %s: %v", coutbuf.f.Name(), err)

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,6 @@ const (
209209
RV_TYPE_MASK = RV_CHECK_OVERFLOW - 1
210210
)
211211

212-
const (
213-
LINKHASH = 100003
214-
)
215-
216212
// Pcdata iterator.
217213
// for(pciterinit(ctxt, &it, &pcd); !it.done; pciternext(&it)) { it.value holds in [it.pc, it.nextpc) }
218214

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ import (
3939
"strconv"
4040
)
4141

42-
func yy_isalpha(c int) bool {
43-
return 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z'
44-
}
45-
4642
var headers = []struct {
4743
name string
4844
val int

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

Lines changed: 0 additions & 29 deletions
This file was deleted.

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,6 @@ func tokenize(s string) []string {
6767
return f
6868
}
6969

70-
func cutStringAtNUL(s string) string {
71-
if i := strings.Index(s, "\x00"); i >= 0 {
72-
s = s[:i]
73-
}
74-
return s
75-
}
76-
77-
func Access(name string, mode int) int {
78-
if mode != 0 {
79-
panic("bad access")
80-
}
81-
_, err := os.Stat(name)
82-
if err != nil {
83-
return -1
84-
}
85-
return 0
86-
}
87-
8870
// strings.Compare, introduced in Go 1.5.
8971
func stringsCompare(a, b string) int {
9072
if a == b {

src/cmd/link/internal/ppc64/l.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ package ppc64
6363

6464
const (
6565
thechar = '9'
66-
PtrSize = 8
67-
IntSize = 8
68-
RegSize = 8
6966
MaxAlign = 32 // max data alignment
7067
FuncAlign = 8
7168
MINLC = 4

src/cmd/link/internal/x86/l.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ package x86
3333
const (
3434
thechar = '8'
3535
PtrSize = 4
36-
IntSize = 4
37-
RegSize = 4
3836
MaxAlign = 32 // max data alignment
3937
FuncAlign = 16
4038
MINLC = 1

0 commit comments

Comments
 (0)