aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj
diff options
context:
space:
mode:
authorMichael Hudson-Doyle <michael.hudson@canonical.com>2015-09-07 15:00:52 +1200
committerMichael Hudson-Doyle <michael.hudson@canonical.com>2015-09-08 21:04:43 +0000
commit69a143e3888982a64427375b3f4bdbd2fee07198 (patch)
tree6dd889b98e0fa22e04fa9bd3b38f4111ef88eddb /src/cmd/internal/obj
parent74a123fcfa94a743d16b22fdc74da3116419a5e5 (diff)
downloadgo-69a143e3888982a64427375b3f4bdbd2fee07198.tar.xz
cmd/internal/obj: remove dead code and small cleanups
Change-Id: I88fa0cc245a2141af04acced8716e08b1133abd1 Reviewed-on: https://go-review.googlesource.com/14350 Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/cmd/internal/obj')
-rw-r--r--src/cmd/internal/obj/arm64/asm7.go1
-rw-r--r--src/cmd/internal/obj/data.go15
-rw-r--r--src/cmd/internal/obj/fmt.go7
-rw-r--r--src/cmd/internal/obj/funcdata.go1
-rw-r--r--src/cmd/internal/obj/libc.go12
-rw-r--r--src/cmd/internal/obj/mgc0.go30
-rw-r--r--src/cmd/internal/obj/objfile.go2
-rw-r--r--src/cmd/internal/obj/sym.go7
-rw-r--r--src/cmd/internal/obj/util.go27
-rw-r--r--src/cmd/internal/obj/x86/asm6.go12
10 files changed, 8 insertions, 106 deletions
diff --git a/src/cmd/internal/obj/arm64/asm7.go b/src/cmd/internal/obj/arm64/asm7.go
index 32f4a903aa..f34dd6dafc 100644
--- a/src/cmd/internal/obj/arm64/asm7.go
+++ b/src/cmd/internal/obj/arm64/asm7.go
@@ -147,7 +147,6 @@ func OPBIT(x uint32) uint32 {
const (
LFROM = 1 << 0
LTO = 1 << 1
- LPOOL = 1 << 2
)
var optab = []Optab{
diff --git a/src/cmd/internal/obj/data.go b/src/cmd/internal/obj/data.go
index 6645b6969d..d3d6786558 100644
--- a/src/cmd/internal/obj/data.go
+++ b/src/cmd/internal/obj/data.go
@@ -239,21 +239,6 @@ func setaddr(ctxt *Link, s *LSym, off int64, t *LSym) int64 {
return setaddrplus(ctxt, s, off, t, 0)
}
-func addsize(ctxt *Link, s *LSym, t *LSym) int64 {
- if s.Type == 0 {
- s.Type = SDATA
- }
- i := s.Size
- s.Size += int64(ctxt.Arch.Ptrsize)
- Symgrow(ctxt, s, s.Size)
- r := Addrel(s)
- r.Sym = t
- r.Off = int32(i)
- r.Siz = uint8(ctxt.Arch.Ptrsize)
- r.Type = R_SIZE
- return i + int64(r.Siz)
-}
-
func addaddrplus4(ctxt *Link, s *LSym, t *LSym, add int64) int64 {
if s.Type == 0 {
s.Type = SDATA
diff --git a/src/cmd/internal/obj/fmt.go b/src/cmd/internal/obj/fmt.go
index 1268f426a5..a6a97d55b5 100644
--- a/src/cmd/internal/obj/fmt.go
+++ b/src/cmd/internal/obj/fmt.go
@@ -17,18 +17,11 @@ package obj
const (
FmtWidth = 1 << iota
FmtLeft
- FmtPrec
FmtSharp
- FmtSpace
FmtSign
- FmtApost
- FmtZero
FmtUnsigned
FmtShort
FmtLong
- FmtVLong
FmtComma
FmtByte
- FmtLDouble
- FmtFlag
)
diff --git a/src/cmd/internal/obj/funcdata.go b/src/cmd/internal/obj/funcdata.go
index 44cba7aae8..dc13028646 100644
--- a/src/cmd/internal/obj/funcdata.go
+++ b/src/cmd/internal/obj/funcdata.go
@@ -74,6 +74,5 @@ const (
PCDATA_StackMapIndex = 0
FUNCDATA_ArgsPointerMaps = 0
FUNCDATA_LocalsPointerMaps = 1
- FUNCDATA_DeadValueMaps = 2
ArgsSizeUnknown = -0x80000000
)
diff --git a/src/cmd/internal/obj/libc.go b/src/cmd/internal/obj/libc.go
deleted file mode 100644
index b200b26047..0000000000
--- a/src/cmd/internal/obj/libc.go
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright 2015 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 obj
-
-const (
- AEXIST = 0
- BOM = 0xFEFF
-)
-
-var GOEXPERIMENT string
diff --git a/src/cmd/internal/obj/mgc0.go b/src/cmd/internal/obj/mgc0.go
deleted file mode 100644
index a385d607bb..0000000000
--- a/src/cmd/internal/obj/mgc0.go
+++ /dev/null
@@ -1,30 +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 obj
-
-// Garbage collector liveness bitmap generation.
-
-// The command line flag -live causes this code to print debug information.
-// The levels are:
-//
-// -live (aka -live=1): print liveness lists as code warnings at safe points
-// -live=2: print an assembly listing with liveness annotations
-// -live=3: print information during each computation phase (much chattier)
-//
-// Each level includes the earlier output as well.
-
-// Copyright 2012 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.
-
-// Used by cmd/gc.
-
-const (
- InsData = 1 + iota
- InsArray
- InsArrayEnd
- InsEnd
- MaxGCMask = 65536
-)
diff --git a/src/cmd/internal/obj/objfile.go b/src/cmd/internal/obj/objfile.go
index 76054e2709..13930aa6c9 100644
--- a/src/cmd/internal/obj/objfile.go
+++ b/src/cmd/internal/obj/objfile.go
@@ -107,8 +107,6 @@ import (
"strings"
)
-var outfile string
-
// The Go and C compilers, and the assembler, call writeobj to write
// out a Go object file. The linker does not call this; the linker
// does not write out object files.
diff --git a/src/cmd/internal/obj/sym.go b/src/cmd/internal/obj/sym.go
index 31c8c2217e..dd5297edc5 100644
--- a/src/cmd/internal/obj/sym.go
+++ b/src/cmd/internal/obj/sym.go
@@ -107,12 +107,7 @@ func Linknew(arch *LinkArch) *Link {
// On arm, record goarm.
if ctxt.Arch.Thechar == '5' {
- p := Getgoarm()
- if p != "" {
- ctxt.Goarm = int32(Atoi(p))
- } else {
- ctxt.Goarm = 6
- }
+ ctxt.Goarm = Getgoarm()
}
return ctxt
diff --git a/src/cmd/internal/obj/util.go b/src/cmd/internal/obj/util.go
index 3c3fc88674..f03eb6943f 100644
--- a/src/cmd/internal/obj/util.go
+++ b/src/cmd/internal/obj/util.go
@@ -11,7 +11,6 @@ import (
"io"
"log"
"os"
- "strconv"
"strings"
"time"
)
@@ -166,17 +165,6 @@ func Brdstr(b *Biobuf, delim int, cut int) string {
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
-}
-
func Blinelen(b *Biobuf) int {
return b.linelen
}
@@ -212,10 +200,14 @@ func Getgoos() string {
return envOr("GOOS", defaultGOOS)
}
-func Getgoarm() string {
+func Getgoarm() int32 {
switch v := envOr("GOARM", defaultGOARM); v {
- case "5", "6", "7":
- return v
+ case "5":
+ return 5
+ case "6":
+ return 6
+ case "7":
+ return 7
}
// Fail here, rather than validate at multiple call sites.
log.Fatalf("Invalid GOARM value. Must be 5, 6, or 7.")
@@ -235,11 +227,6 @@ func Getgoversion() string {
return version
}
-func Atoi(s string) int {
- i, _ := strconv.Atoi(s)
- return i
-}
-
func (p *Prog) Line() string {
return p.Ctxt.LineHist.LineString(int(p.Lineno))
}
diff --git a/src/cmd/internal/obj/x86/asm6.go b/src/cmd/internal/obj/x86/asm6.go
index 7a69dc8414..0aa986187a 100644
--- a/src/cmd/internal/obj/x86/asm6.go
+++ b/src/cmd/internal/obj/x86/asm6.go
@@ -40,8 +40,6 @@ import (
// Instruction layout.
const (
- MaxAlign = 32 // max data alignment
-
// Loop alignment constants:
// want to align loop entry to LoopAlign-byte boundary,
// and willing to insert at most MaxLoopPad bytes of NOP to do so.
@@ -175,7 +173,6 @@ const (
Zil_rp
Ziq_rp
Zilo_m
- Ziqo_m
Zjmp
Zjmpcon
Zloop
@@ -225,14 +222,10 @@ const (
Py1 = 0x81 // symbolic; exact value doesn't matter
Py3 = 0x83 // symbolic; exact value doesn't matter
- Rxf = 1 << 9 /* internal flag for Rxr on from */
- Rxt = 1 << 8 /* internal flag for Rxr on to */
Rxw = 1 << 3 /* =1, 64-bit operand size */
Rxr = 1 << 2 /* extend modrm reg */
Rxx = 1 << 1 /* extend sib index */
Rxb = 1 << 0 /* extend modrm r/m, sib base, or opcode reg */
-
- Maxand = 10 /* in -a output width of the byte codes */
)
var ycover [Ymax * Ymax]uint8
@@ -245,11 +238,6 @@ var ynone = []ytab{
{Ynone, Ynone, Ynone, Zlit, 1},
}
-var ysahf = []ytab{
- {Ynone, Ynone, Ynone, Zlit, 2},
- {Ynone, Ynone, Ynone, Zlit, 1},
-}
-
var ytext = []ytab{
{Ymb, Ynone, Ytextsize, Zpseudo, 0},
{Ymb, Yi32, Ytextsize, Zpseudo, 1},