cmd/link/internal: rename LSym to Symbol, and add a doc comment.

I'd also like to document some of its fields, but I don't know
what they are.

Change-Id: I87d341e255f785d351a8a73e645be668e02b2689
Reviewed-on: https://go-review.googlesource.com/27399
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Michael Matloob 2016-08-19 11:35:54 -04:00
parent 0a2a64d85d
commit a072fc2e67
24 changed files with 291 additions and 289 deletions

View file

@ -95,10 +95,10 @@ type Arch struct {
Openbsddynld string
Dragonflydynld string
Solarisdynld string
Adddynrel func(*LSym, *Reloc)
Adddynrel func(*Symbol, *Reloc)
Archinit func()
Archreloc func(*Reloc, *LSym, *int64) int
Archrelocvariant func(*Reloc, *LSym, int64) int64
Archreloc func(*Reloc, *Symbol, *int64) int
Archrelocvariant func(*Reloc, *Symbol, int64) int64
Asmb func()
Elfreloc1 func(*Reloc, int64) int
Elfsetupplt func()
@ -189,7 +189,7 @@ func UseRelro() bool {
var (
SysArch *sys.Arch
outfile string
dynexp []*LSym
dynexp []*Symbol
dynlib []string
ldflag []string
havedynamic int
@ -1541,7 +1541,7 @@ func ldshlibsyms(shlib string) {
Diag("cannot read symbols from shared library: %s", libpath)
return
}
gcdata_locations := make(map[uint64]*LSym)
gcdata_locations := make(map[uint64]*Symbol)
for _, elfsym := range syms {
if elf.ST_TYPE(elfsym.Info) == elf.STT_NOTYPE || elf.ST_TYPE(elfsym.Info) == elf.STT_SECTION {
continue
@ -1568,7 +1568,7 @@ func ldshlibsyms(shlib string) {
}
}
}
gcdata_addresses := make(map[*LSym]uint64)
gcdata_addresses := make(map[*Symbol]uint64)
if SysArch.Family == sys.ARM64 {
for _, sect := range f.Sections {
if sect.Type == elf.SHT_RELA {
@ -1597,7 +1597,7 @@ func ldshlibsyms(shlib string) {
// We might have overwritten some functions above (this tends to happen for the
// autogenerated type equality/hashing functions) and we don't want to generated
// pcln table entries for these any more so remove them from Textp.
textp := make([]*LSym, 0, len(Ctxt.Textp))
textp := make([]*Symbol, 0, len(Ctxt.Textp))
for _, s := range Ctxt.Textp {
if s.Type != obj.SDYNIMPORT {
textp = append(textp, s)
@ -1678,12 +1678,12 @@ func Be32(b []byte) uint32 {
}
type Chain struct {
sym *LSym
sym *Symbol
up *Chain
limit int // limit on entry to sym
}
var morestack *LSym
var morestack *Symbol
// TODO: Record enough information in new object files to
// allow stack checks here.
@ -1949,7 +1949,7 @@ func doversion() {
Exitf("version %s", obj.Getgoversion())
}
func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
func genasmsym(put func(*Symbol, string, int, int64, int64, int, *Symbol)) {
// These symbols won't show up in the first loop below because we
// skip STEXT symbols. Normal STEXT symbols are emitted by walking textp.
s := Linklookup(Ctxt, "runtime.text", 0)
@ -2079,7 +2079,7 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
Bso.Flush()
}
func Symaddr(s *LSym) int64 {
func Symaddr(s *Symbol) int64 {
if !s.Attr.Reachable() {
Diag("unreachable symbol in symaddr - %s", s.Name)
}
@ -2121,7 +2121,7 @@ func Entryvalue() int64 {
return s.Value
}
func undefsym(s *LSym) {
func undefsym(s *Symbol) {
var r *Reloc
Ctxt.Cursym = s