1
0
mirror of https://github.com/golang/go synced 2024-11-23 20:00:04 -07:00

cmd/link: remove references to LSym (now Symbol)

Mostly comments but some derived names too.

Change-Id: I1e01dccca98de6688e1426c7a9309f6fd6a1e368
Reviewed-on: https://go-review.googlesource.com/27415
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Michael Hudson-Doyle 2016-08-22 10:27:20 +12:00
parent 85072d5f75
commit 8e90b9026b
6 changed files with 19 additions and 19 deletions

View File

@ -239,7 +239,7 @@ func addaddrplus4(ctxt *Link, s *Symbol, t *Symbol, add int64) int64 {
/* /*
* divide-and-conquer list-link * divide-and-conquer list-link
* sort of LSym* structures. * sort of Symbol* structures.
* Used for the data block. * Used for the data block.
*/ */
@ -1161,12 +1161,12 @@ func (p *GCProg) AddSym(s *Symbol) {
p.w.Append(prog[4:], nptr) p.w.Append(prog[4:], nptr)
} }
// dataSortKey is used to sort a slice of data symbol *LSym pointers. // dataSortKey is used to sort a slice of data symbol *Symbol pointers.
// The sort keys are kept inline to improve cache behaviour while sorting. // The sort keys are kept inline to improve cache behaviour while sorting.
type dataSortKey struct { type dataSortKey struct {
size int64 size int64
name string name string
lsym *Symbol sym *Symbol
} }
type bySizeAndName []dataSortKey type bySizeAndName []dataSortKey
@ -1786,7 +1786,7 @@ func dodataSect(ctxt *Link, symn int, syms []*Symbol) (result []*Symbol, maxAlig
symsSort[i] = dataSortKey{ symsSort[i] = dataSortKey{
size: s.Size, size: s.Size,
name: s.Name, name: s.Name,
lsym: s, sym: s,
} }
switch s.Type { switch s.Type {
@ -1806,8 +1806,8 @@ func dodataSect(ctxt *Link, symn int, syms []*Symbol) (result []*Symbol, maxAlig
sort.Sort(bySizeAndName(symsSort)) sort.Sort(bySizeAndName(symsSort))
for i, symSort := range symsSort { for i, symSort := range symsSort {
syms[i] = symSort.lsym syms[i] = symSort.sym
align := symalign(symSort.lsym) align := symalign(symSort.sym)
if maxAlign < align { if maxAlign < align {
maxAlign = align maxAlign = align
} }

View File

@ -1640,7 +1640,7 @@ func elfshbits(ctxt *Link, sect *Section) *ElfShdr {
// in a loadable segment (e.g. the abihash note) but not for // in a loadable segment (e.g. the abihash note) but not for
// notes that we do not want to be mapped (e.g. the package // notes that we do not want to be mapped (e.g. the package
// list note). The real fix is probably to define new values // list note). The real fix is probably to define new values
// for LSym.Type corresponding to mapped and unmapped notes // for Symbol.Type corresponding to mapped and unmapped notes
// and handle them in dodata(). // and handle them in dodata().
ctxt.Diag("sh.type_ == SHT_NOTE in elfshbits when linking internally") ctxt.Diag("sh.type_ == SHT_NOTE in elfshbits when linking internally")
} }

View File

@ -182,7 +182,7 @@ type Link struct {
Textp []*Symbol Textp []*Symbol
Filesyms []*Symbol Filesyms []*Symbol
Moduledata *Symbol Moduledata *Symbol
LSymBatch []Symbol SymbolBatch []Symbol
} }
// The smallest possible offset from the hardware stack pointer to a local // The smallest possible offset from the hardware stack pointer to a local

View File

@ -44,11 +44,11 @@ package ld
// A symbol reference is a string name followed by a version. // A symbol reference is a string name followed by a version.
// //
// A symbol points to other symbols using an index into the symbol // A symbol points to other symbols using an index into the symbol
// reference sequence. Index 0 corresponds to a nil LSym* pointer. // reference sequence. Index 0 corresponds to a nil Object* pointer.
// In the symbol layout described below "symref index" stands for this // In the symbol layout described below "symref index" stands for this
// index. // index.
// //
// Each symbol is laid out as the following fields (taken from LSym*): // Each symbol is laid out as the following fields (taken from Object*):
// //
// - byte 0xfe (sanity check for synchronization) // - byte 0xfe (sanity check for synchronization)
// - type [int] // - type [int]

View File

@ -161,12 +161,12 @@ func linknew(arch *sys.Arch) *Link {
} }
func linknewsym(ctxt *Link, name string, v int) *Symbol { func linknewsym(ctxt *Link, name string, v int) *Symbol {
batch := ctxt.LSymBatch batch := ctxt.SymbolBatch
if len(batch) == 0 { if len(batch) == 0 {
batch = make([]Symbol, 1000) batch = make([]Symbol, 1000)
} }
s := &batch[0] s := &batch[0]
ctxt.LSymBatch = batch[1:] ctxt.SymbolBatch = batch[1:]
s.Dynid = -1 s.Dynid = -1
s.Plt = -1 s.Plt = -1

View File

@ -46,7 +46,7 @@ func putelfstr(s string) int {
putelfstr("") putelfstr("")
} }
// When dynamically linking, we create LSym's by reading the names from // When dynamically linking, we create Symbols by reading the names from
// the symbol tables of the shared libraries and so the names need to // the symbol tables of the shared libraries and so the names need to
// match exactly. Tools like DTrace will have to wait for now. // match exactly. Tools like DTrace will have to wait for now.
if !DynlinkingGo() { if !DynlinkingGo() {
@ -168,7 +168,7 @@ func putelfsym(ctxt *Link, x *Symbol, s string, t int, addr int64, size int64, v
// PLT. We force this by writing an additional local symbol for every // PLT. We force this by writing an additional local symbol for every
// global function symbol and making all relocations against the // global function symbol and making all relocations against the
// global symbol refer to this local symbol instead (see // global symbol refer to this local symbol instead (see
// (*LSym).ElfsymForReloc). This is approximately equivalent to the // (*Symbol).ElfsymForReloc). This is approximately equivalent to the
// ELF linker -Bsymbolic-functions option, but that is buggy on // ELF linker -Bsymbolic-functions option, but that is buggy on
// several platforms. // several platforms.
putelfsyment(putelfstr("local."+s), addr, size, STB_LOCAL<<4|type_&0xf, elfshnum, other) putelfsyment(putelfstr("local."+s), addr, size, STB_LOCAL<<4|type_&0xf, elfshnum, other)