Commit d2a95451 authored by Michael Hudson-Doyle's avatar Michael Hudson-Doyle

cmd/internal: remove SymKind values that are only checked for, never set

Change-Id: Id152767c033c12966e9e12ae303b99f38776f919
Reviewed-on: https://go-review.googlesource.com/40987
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent 794d29a4
...@@ -606,10 +606,6 @@ func (c *ctxt0) aclass(a *obj.Addr) int { ...@@ -606,10 +606,6 @@ func (c *ctxt0) aclass(a *obj.Addr) int {
if s == nil { if s == nil {
break break
} }
if s.Type == objabi.SCONST {
c.instoffset = a.Offset
goto consize
}
c.instoffset = a.Offset c.instoffset = a.Offset
if s.Type == objabi.STLSBSS { if s.Type == objabi.STLSBSS {
......
...@@ -162,7 +162,7 @@ func (ctxt *Link) Globl(s *LSym, size int64, flag int) { ...@@ -162,7 +162,7 @@ func (ctxt *Link) Globl(s *LSym, size int64, flag int) {
s.Set(AttrOnList, true) s.Set(AttrOnList, true)
ctxt.Data = append(ctxt.Data, s) ctxt.Data = append(ctxt.Data, s)
s.Size = size s.Size = size
if s.Type == 0 || s.Type == objabi.SXREF { if s.Type == 0 {
s.Type = objabi.SBSS s.Type = objabi.SBSS
} }
if flag&DUPOK != 0 { if flag&DUPOK != 0 {
......
...@@ -810,10 +810,6 @@ func (c *ctxt9) aclass(a *obj.Addr) int { ...@@ -810,10 +810,6 @@ func (c *ctxt9) aclass(a *obj.Addr) int {
if s == nil { if s == nil {
break break
} }
if s.Type == objabi.SCONST {
c.instoffset = a.Offset
goto consize
}
c.instoffset = a.Offset c.instoffset = a.Offset
......
...@@ -558,9 +558,6 @@ func (c *ctxtz) aclass(a *obj.Addr) int { ...@@ -558,9 +558,6 @@ func (c *ctxtz) aclass(a *obj.Addr) int {
break break
} }
c.instoffset = a.Offset c.instoffset = a.Offset
if s.Type == objabi.SCONST {
goto consize
}
return C_SYMADDR return C_SYMADDR
......
...@@ -54,10 +54,6 @@ const ( ...@@ -54,10 +54,6 @@ const (
SNOPTRBSS SNOPTRBSS
// Thread-local data that is initally all 0s // Thread-local data that is initally all 0s
STLSBSS STLSBSS
// TODO(mwhudson): outside of the linker, these values are
// only checked for, not set, so they should be removed.
SXREF
SCONST
// Debugging data // Debugging data
SDWARFINFO SDWARFINFO
) )
...@@ -4,9 +4,9 @@ package objabi ...@@ -4,9 +4,9 @@ package objabi
import "fmt" import "fmt"
const _SymKind_name = "SxxxSTEXTSRODATASNOPTRDATASDATASBSSSNOPTRBSSSTLSBSSSXREFSCONSTSDWARFINFO" const _SymKind_name = "SxxxSTEXTSRODATASNOPTRDATASDATASBSSSNOPTRBSSSTLSBSSSDWARFINFO"
var _SymKind_index = [...]uint8{0, 4, 9, 16, 26, 31, 35, 44, 51, 56, 62, 72} var _SymKind_index = [...]uint8{0, 4, 9, 16, 26, 31, 35, 44, 51, 61}
func (i SymKind) String() string { func (i SymKind) String() string {
if i < 0 || i >= SymKind(len(_SymKind_index)-1) { if i < 0 || i >= SymKind(len(_SymKind_index)-1) {
......
...@@ -53,8 +53,6 @@ func (f *goobjFile) symbols() ([]Sym, error) { ...@@ -53,8 +53,6 @@ func (f *goobjFile) symbols() ([]Sym, error) {
sym.Code = 'D' sym.Code = 'D'
case objabi.SBSS, objabi.SNOPTRBSS, objabi.STLSBSS: case objabi.SBSS, objabi.SNOPTRBSS, objabi.STLSBSS:
sym.Code = 'B' sym.Code = 'B'
case objabi.SXREF, objabi.SCONST:
sym.Code = 'X' // should not see
} }
if s.Version != 0 { if s.Version != 0 {
sym.Code += 'a' - 'A' sym.Code += 'a' - 'A'
......
...@@ -121,8 +121,6 @@ var abiSymKindToSymKind = [...]SymKind{ ...@@ -121,8 +121,6 @@ var abiSymKindToSymKind = [...]SymKind{
SBSS, SBSS,
SNOPTRBSS, SNOPTRBSS,
STLSBSS, STLSBSS,
SXREF,
SCONST,
SDWARFINFO, SDWARFINFO,
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment