Commit a072fc2e authored by Michael Matloob's avatar Michael Matloob

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/27399Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 0a2a64d8
......@@ -42,7 +42,7 @@ func PADDR(x uint32) uint32 {
return x &^ 0x80000000
}
func Addcall(ctxt *ld.Link, s *ld.LSym, t *ld.LSym) int64 {
func Addcall(ctxt *ld.Link, s *ld.Symbol, t *ld.Symbol) int64 {
s.Attr |= ld.AttrReachable
i := s.Size
s.Size += 4
......@@ -94,7 +94,7 @@ func gentext() {
ld.Addaddr(ld.Ctxt, initarray_entry, initfunc)
}
func adddynrel(s *ld.LSym, r *ld.Reloc) {
func adddynrel(s *ld.Symbol, r *ld.Reloc) {
targ := r.Sym
ld.Ctxt.Cursym = s
......@@ -472,11 +472,11 @@ func pereloc1(r *ld.Reloc, sectoff int64) bool {
return true
}
func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
func archreloc(r *ld.Reloc, s *ld.Symbol, val *int64) int {
return -1
}
func archrelocvariant(r *ld.Reloc, s *ld.LSym, t int64) int64 {
func archrelocvariant(r *ld.Reloc, s *ld.Symbol, t int64) int64 {
log.Fatalf("unexpected relocation variant")
return t
}
......@@ -508,7 +508,7 @@ func elfsetupplt() {
}
}
func addpltsym(s *ld.LSym) {
func addpltsym(s *ld.Symbol) {
if s.Plt >= 0 {
return
}
......@@ -576,7 +576,7 @@ func addpltsym(s *ld.LSym) {
}
}
func addgotsym(s *ld.LSym) {
func addgotsym(s *ld.Symbol) {
if s.Got >= 0 {
return
}
......
......@@ -109,7 +109,7 @@ func braddoff(a int32, b int32) int32 {
return int32((uint32(a))&0xff000000 | 0x00ffffff&uint32(a+b))
}
func adddynrel(s *ld.LSym, r *ld.Reloc) {
func adddynrel(s *ld.Symbol, r *ld.Reloc) {
targ := r.Sym
ld.Ctxt.Cursym = s
......@@ -410,7 +410,7 @@ func machoreloc1(r *ld.Reloc, sectoff int64) int {
return 0
}
func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
func archreloc(r *ld.Reloc, s *ld.Symbol, val *int64) int {
if ld.Linkmode == ld.LinkExternal {
switch r.Type {
case obj.R_CALLARM:
......@@ -487,12 +487,12 @@ func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
return -1
}
func archrelocvariant(r *ld.Reloc, s *ld.LSym, t int64) int64 {
func archrelocvariant(r *ld.Reloc, s *ld.Symbol, t int64) int64 {
log.Fatalf("unexpected relocation variant")
return t
}
func addpltreloc(ctxt *ld.Link, plt *ld.LSym, got *ld.LSym, sym *ld.LSym, typ int) *ld.Reloc {
func addpltreloc(ctxt *ld.Link, plt *ld.Symbol, got *ld.Symbol, sym *ld.Symbol, typ int) *ld.Reloc {
r := ld.Addrel(plt)
r.Sym = got
r.Off = int32(plt.Size)
......@@ -507,7 +507,7 @@ func addpltreloc(ctxt *ld.Link, plt *ld.LSym, got *ld.LSym, sym *ld.LSym, typ in
return r
}
func addpltsym(ctxt *ld.Link, s *ld.LSym) {
func addpltsym(ctxt *ld.Link, s *ld.Symbol) {
if s.Plt >= 0 {
return
}
......@@ -546,7 +546,7 @@ func addpltsym(ctxt *ld.Link, s *ld.LSym) {
}
}
func addgotsyminternal(ctxt *ld.Link, s *ld.LSym) {
func addgotsyminternal(ctxt *ld.Link, s *ld.Symbol) {
if s.Got >= 0 {
return
}
......@@ -562,7 +562,7 @@ func addgotsyminternal(ctxt *ld.Link, s *ld.LSym) {
}
}
func addgotsym(ctxt *ld.Link, s *ld.LSym) {
func addgotsym(ctxt *ld.Link, s *ld.Symbol) {
if s.Got >= 0 {
return
}
......
......@@ -86,7 +86,7 @@ func gentext() {
ld.Addaddr(ld.Ctxt, initarray_entry, initfunc)
}
func adddynrel(s *ld.LSym, r *ld.Reloc) {
func adddynrel(s *ld.Symbol, r *ld.Reloc) {
log.Fatalf("adddynrel not implemented")
}
......@@ -226,7 +226,7 @@ func machoreloc1(r *ld.Reloc, sectoff int64) int {
return 0
}
func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
func archreloc(r *ld.Reloc, s *ld.Symbol, val *int64) int {
if ld.Linkmode == ld.LinkExternal {
switch r.Type {
default:
......@@ -385,7 +385,7 @@ func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
return -1
}
func archrelocvariant(r *ld.Reloc, s *ld.LSym, t int64) int64 {
func archrelocvariant(r *ld.Reloc, s *ld.Symbol, t int64) int64 {
log.Fatalf("unexpected relocation variant")
return -1
}
......
This diff is collapsed.
......@@ -119,7 +119,7 @@ func deadcode(ctxt *Link) {
}
// Remove dead text but keep file information (z symbols).
textp := make([]*LSym, 0, len(ctxt.Textp))
textp := make([]*Symbol, 0, len(ctxt.Textp))
for _, s := range ctxt.Textp {
if s.Attr.Reachable() {
textp = append(textp, s)
......@@ -154,11 +154,11 @@ var markextra = []string{
// the reflect.method struct: mtyp, ifn, and tfn.
type methodref struct {
m methodsig
src *LSym // receiver type symbol
src *Symbol // receiver type symbol
r [3]*Reloc // R_METHODOFF relocations to fields of runtime.method
}
func (m methodref) ifn() *LSym { return m.r[1].Sym }
func (m methodref) ifn() *Symbol { return m.r[1].Sym }
func (m methodref) isExported() bool {
for _, r := range m.m {
......@@ -170,7 +170,7 @@ func (m methodref) isExported() bool {
// deadcodepass holds state for the deadcode flood fill.
type deadcodepass struct {
ctxt *Link
markQueue []*LSym // symbols to flood fill in next pass
markQueue []*Symbol // symbols to flood fill in next pass
ifaceMethod map[methodsig]bool // methods declared in reached interfaces
markableMethods []methodref // methods of reached types
reflectMethod bool
......@@ -189,7 +189,7 @@ func (d *deadcodepass) cleanupReloc(r *Reloc) {
}
// mark appends a symbol to the mark queue for flood filling.
func (d *deadcodepass) mark(s, parent *LSym) {
func (d *deadcodepass) mark(s, parent *Symbol) {
if s == nil || s.Attr.Reachable() {
return
}
......
......@@ -28,7 +28,7 @@ const (
tflagExtraStar = 1 << 1
)
func decode_reloc(s *LSym, off int32) *Reloc {
func decode_reloc(s *Symbol, off int32) *Reloc {
for i := range s.R {
if s.R[i].Off == off {
return &s.R[i]
......@@ -37,7 +37,7 @@ func decode_reloc(s *LSym, off int32) *Reloc {
return nil
}
func decode_reloc_sym(s *LSym, off int32) *LSym {
func decode_reloc_sym(s *Symbol, off int32) *Symbol {
r := decode_reloc(s, off)
if r == nil {
return nil
......@@ -64,27 +64,27 @@ func structfieldSize() int { return 3 * SysArch.PtrSize } // runtime.struc
func uncommonSize() int { return 4 + 2 + 2 + 4 + 4 } // runtime.uncommontype
// Type.commonType.kind
func decodetype_kind(s *LSym) uint8 {
func decodetype_kind(s *Symbol) uint8 {
return s.P[2*SysArch.PtrSize+7] & obj.KindMask // 0x13 / 0x1f
}
// Type.commonType.kind
func decodetype_usegcprog(s *LSym) uint8 {
func decodetype_usegcprog(s *Symbol) uint8 {
return s.P[2*SysArch.PtrSize+7] & obj.KindGCProg // 0x13 / 0x1f
}
// Type.commonType.size
func decodetype_size(s *LSym) int64 {
func decodetype_size(s *Symbol) int64 {
return int64(decode_inuxi(s.P, SysArch.PtrSize)) // 0x8 / 0x10
}
// Type.commonType.ptrdata
func decodetype_ptrdata(s *LSym) int64 {
func decodetype_ptrdata(s *Symbol) int64 {
return int64(decode_inuxi(s.P[SysArch.PtrSize:], SysArch.PtrSize)) // 0x8 / 0x10
}
// Type.commonType.tflag
func decodetype_hasUncommon(s *LSym) bool {
func decodetype_hasUncommon(s *Symbol) bool {
return s.P[2*SysArch.PtrSize+4]&tflagUncommon != 0
}
......@@ -103,7 +103,7 @@ func findShlibSection(path string, addr uint64) *elf.Section {
}
// Type.commonType.gc
func decodetype_gcprog(s *LSym) []byte {
func decodetype_gcprog(s *Symbol) []byte {
if s.Type == obj.SDYNIMPORT {
addr := decodetype_gcprog_shlib(s)
sect := findShlibSection(s.File, addr)
......@@ -122,7 +122,7 @@ func decodetype_gcprog(s *LSym) []byte {
return decode_reloc_sym(s, 2*int32(SysArch.PtrSize)+8+1*int32(SysArch.PtrSize)).P
}
func decodetype_gcprog_shlib(s *LSym) uint64 {
func decodetype_gcprog_shlib(s *Symbol) uint64 {
if SysArch.Family == sys.ARM64 {
for _, shlib := range Ctxt.Shlibs {
if shlib.Path == s.File {
......@@ -134,7 +134,7 @@ func decodetype_gcprog_shlib(s *LSym) uint64 {
return decode_inuxi(s.P[2*int32(SysArch.PtrSize)+8+1*int32(SysArch.PtrSize):], SysArch.PtrSize)
}
func decodetype_gcmask(s *LSym) []byte {
func decodetype_gcmask(s *Symbol) []byte {
if s.Type == obj.SDYNIMPORT {
addr := decodetype_gcprog_shlib(s)
ptrdata := decodetype_ptrdata(s)
......@@ -152,48 +152,48 @@ func decodetype_gcmask(s *LSym) []byte {
}
// Type.ArrayType.elem and Type.SliceType.Elem
func decodetype_arrayelem(s *LSym) *LSym {
func decodetype_arrayelem(s *Symbol) *Symbol {
return decode_reloc_sym(s, int32(commonsize())) // 0x1c / 0x30
}
func decodetype_arraylen(s *LSym) int64 {
func decodetype_arraylen(s *Symbol) int64 {
return int64(decode_inuxi(s.P[commonsize()+2*SysArch.PtrSize:], SysArch.PtrSize))
}
// Type.PtrType.elem
func decodetype_ptrelem(s *LSym) *LSym {
func decodetype_ptrelem(s *Symbol) *Symbol {
return decode_reloc_sym(s, int32(commonsize())) // 0x1c / 0x30
}
// Type.MapType.key, elem
func decodetype_mapkey(s *LSym) *LSym {
func decodetype_mapkey(s *Symbol) *Symbol {
return decode_reloc_sym(s, int32(commonsize())) // 0x1c / 0x30
}
func decodetype_mapvalue(s *LSym) *LSym {
func decodetype_mapvalue(s *Symbol) *Symbol {
return decode_reloc_sym(s, int32(commonsize())+int32(SysArch.PtrSize)) // 0x20 / 0x38
}
// Type.ChanType.elem
func decodetype_chanelem(s *LSym) *LSym {
func decodetype_chanelem(s *Symbol) *Symbol {
return decode_reloc_sym(s, int32(commonsize())) // 0x1c / 0x30
}
// Type.FuncType.dotdotdot
func decodetype_funcdotdotdot(s *LSym) bool {
func decodetype_funcdotdotdot(s *Symbol) bool {
return uint16(decode_inuxi(s.P[commonsize()+2:], 2))&(1<<15) != 0
}
// Type.FuncType.inCount
func decodetype_funcincount(s *LSym) int {
func decodetype_funcincount(s *Symbol) int {
return int(decode_inuxi(s.P[commonsize():], 2))
}
func decodetype_funcoutcount(s *LSym) int {
func decodetype_funcoutcount(s *Symbol) int {
return int(uint16(decode_inuxi(s.P[commonsize()+2:], 2)) & (1<<15 - 1))
}
func decodetype_funcintype(s *LSym, i int) *LSym {
func decodetype_funcintype(s *Symbol, i int) *Symbol {
uadd := commonsize() + 4
if SysArch.PtrSize == 8 {
uadd += 4
......@@ -204,16 +204,16 @@ func decodetype_funcintype(s *LSym, i int) *LSym {
return decode_reloc_sym(s, int32(uadd+i*SysArch.PtrSize))
}
func decodetype_funcouttype(s *LSym, i int) *LSym {
func decodetype_funcouttype(s *Symbol, i int) *Symbol {
return decodetype_funcintype(s, i+decodetype_funcincount(s))
}
// Type.StructType.fields.Slice::length
func decodetype_structfieldcount(s *LSym) int {
func decodetype_structfieldcount(s *Symbol) int {
return int(decode_inuxi(s.P[commonsize()+2*SysArch.PtrSize:], SysArch.IntSize))
}
func decodetype_structfieldarrayoff(s *LSym, i int) int {
func decodetype_structfieldarrayoff(s *Symbol, i int) int {
off := commonsize() + 2*SysArch.PtrSize + 2*SysArch.IntSize
if decodetype_hasUncommon(s) {
off += uncommonSize()
......@@ -223,7 +223,7 @@ func decodetype_structfieldarrayoff(s *LSym, i int) int {
}
// decodetype_str returns the contents of an rtype's str field (a nameOff).
func decodetype_str(s *LSym) string {
func decodetype_str(s *Symbol) string {
str := decodetype_name(s, 4*SysArch.PtrSize+8)
if s.P[2*SysArch.PtrSize+4]&tflagExtraStar != 0 {
return str[1:]
......@@ -232,7 +232,7 @@ func decodetype_str(s *LSym) string {
}
// decodetype_name decodes the name from a reflect.name.
func decodetype_name(s *LSym, off int) string {
func decodetype_name(s *Symbol, off int) string {
r := decode_reloc(s, int32(off))
if r == nil {
return ""
......@@ -243,23 +243,23 @@ func decodetype_name(s *LSym, off int) string {
return string(data[3 : 3+namelen])
}
func decodetype_structfieldname(s *LSym, i int) string {
func decodetype_structfieldname(s *Symbol, i int) string {
off := decodetype_structfieldarrayoff(s, i)
return decodetype_name(s, off)
}
func decodetype_structfieldtype(s *LSym, i int) *LSym {
func decodetype_structfieldtype(s *Symbol, i int) *Symbol {
off := decodetype_structfieldarrayoff(s, i)
return decode_reloc_sym(s, int32(off+SysArch.PtrSize))
}
func decodetype_structfieldoffs(s *LSym, i int) int64 {
func decodetype_structfieldoffs(s *Symbol, i int) int64 {
off := decodetype_structfieldarrayoff(s, i)
return int64(decode_inuxi(s.P[off+2*SysArch.PtrSize:], SysArch.IntSize))
}
// InterfaceType.methods.length
func decodetype_ifacemethodcount(s *LSym) int64 {
func decodetype_ifacemethodcount(s *Symbol) int64 {
return int64(decode_inuxi(s.P[commonsize()+2*SysArch.PtrSize:], SysArch.IntSize))
}
......@@ -286,7 +286,7 @@ const (
// the function type.
//
// Conveniently this is the layout of both runtime.method and runtime.imethod.
func decode_methodsig(s *LSym, off, size, count int) []methodsig {
func decode_methodsig(s *Symbol, off, size, count int) []methodsig {
var buf bytes.Buffer
var methods []methodsig
for i := 0; i < count; i++ {
......@@ -318,7 +318,7 @@ func decode_methodsig(s *LSym, off, size, count int) []methodsig {
return methods
}
func decodetype_ifacemethods(s *LSym) []methodsig {
func decodetype_ifacemethods(s *Symbol) []methodsig {
if decodetype_kind(s)&kindMask != kindInterface {
panic(fmt.Sprintf("symbol %q is not an interface", s.Name))
}
......@@ -335,7 +335,7 @@ func decodetype_ifacemethods(s *LSym) []methodsig {
return decode_methodsig(s, off, sizeofIMethod, numMethods)
}
func decodetype_methods(s *LSym) []methodsig {
func decodetype_methods(s *Symbol) []methodsig {
if !decodetype_hasUncommon(s) {
panic(fmt.Sprintf("no methods on %q", s.Name))
}
......
This diff is collapsed.
......@@ -806,7 +806,7 @@ type ElfShdr struct {
addralign uint64
entsize uint64
shnum int
secsym *LSym
secsym *Symbol
}
/*
......@@ -1173,7 +1173,7 @@ func elfhash(name string) uint32 {
return h
}
func Elfwritedynent(s *LSym, tag int, val uint64) {
func Elfwritedynent(s *Symbol, tag int, val uint64) {
if elf64 {
Adduint64(Ctxt, s, uint64(tag))
Adduint64(Ctxt, s, val)
......@@ -1183,11 +1183,11 @@ func Elfwritedynent(s *LSym, tag int, val uint64) {
}
}
func elfwritedynentsym(s *LSym, tag int, t *LSym) {
func elfwritedynentsym(s *Symbol, tag int, t *Symbol) {
Elfwritedynentsymplus(s, tag, t, 0)
}
func Elfwritedynentsymplus(s *LSym, tag int, t *LSym, add int64) {
func Elfwritedynentsymplus(s *Symbol, tag int, t *Symbol, add int64) {
if elf64 {
Adduint64(Ctxt, s, uint64(tag))
} else {
......@@ -1196,7 +1196,7 @@ func Elfwritedynentsymplus(s *LSym, tag int, t *LSym, add int64) {
Addaddrplus(Ctxt, s, t, add)
}
func elfwritedynentsymsize(s *LSym, tag int, t *LSym) {
func elfwritedynentsymsize(s *Symbol, tag int, t *Symbol) {
if elf64 {
Adduint64(Ctxt, s, uint64(tag))
} else {
......@@ -1719,7 +1719,7 @@ func elfshreloc(sect *Section) *ElfShdr {
return sh
}
func elfrelocsect(sect *Section, syms []*LSym) {
func elfrelocsect(sect *Section, syms []*Symbol) {
// If main section is SHT_NOBITS, nothing to relocate.
// Also nothing to relocate in .shstrtab.
if sect.Vaddr >= sect.Seg.Vaddr+sect.Seg.Filelen {
......@@ -2086,7 +2086,7 @@ func doelf() {
}
// Do not write DT_NULL. elfdynhash will finish it.
func shsym(sh *ElfShdr, s *LSym) {
func shsym(sh *ElfShdr, s *Symbol) {
addr := Symaddr(s)
if sh.flags&SHF_ALLOC != 0 {
sh.addr = uint64(addr)
......@@ -2604,7 +2604,7 @@ elfobj:
}
}
func Elfadddynsym(ctxt *Link, s *LSym) {
func Elfadddynsym(ctxt *Link, s *Symbol) {
if elf64 {
s.Dynid = int32(Nelfsym)
Nelfsym++
......
......@@ -132,7 +132,7 @@ func loadcgo(file string, pkg string, p string) {
var local string
var remote string
var lib string
var s *LSym
var s *Symbol
p0 := ""
for ; p != ""; p = next {
......@@ -315,7 +315,7 @@ func adddynlib(lib string) {
}
}
func Adddynsym(ctxt *Link, s *LSym) {
func Adddynsym(ctxt *Link, s *Symbol) {
if s.Dynid >= 0 || Linkmode == LinkExternal {
return
}
......
......@@ -264,7 +264,7 @@ type ElfSect struct {
align uint64
entsize uint64
base []byte
sym *LSym
sym *Symbol
}
type ElfObj struct {
......@@ -303,12 +303,12 @@ type ElfSym struct {
type_ uint8
other uint8
shndx uint16
sym *LSym
sym *Symbol
}
var ElfMagic = [4]uint8{0x7F, 'E', 'L', 'F'}
func valuecmp(a *LSym, b *LSym) int {
func valuecmp(a *Symbol, b *Symbol) int {
if a.Value < b.Value {
return -1
}
......@@ -472,10 +472,10 @@ func ldelf(f *bio.Reader, pkg string, length int64, pn string) {
var rela int
var rp *Reloc
var rsect *ElfSect
var s *LSym
var s *Symbol
var sect *ElfSect
var sym ElfSym
var symbols []*LSym
var symbols []*Symbol
if _, err := io.ReadFull(f, hdrbuf[:]); err != nil {
goto bad
}
......@@ -745,7 +745,7 @@ func ldelf(f *bio.Reader, pkg string, length int64, pn string) {
// enter sub-symbols into symbol table.
// symbol 0 is the null symbol.
symbols = make([]*LSym, elfobj.nsymtab)
symbols = make([]*Symbol, elfobj.nsymtab)
for i := 1; i < elfobj.nsymtab; i++ {
if err = readelfsym(elfobj, i, &sym, 1); err != nil {
......@@ -1022,7 +1022,7 @@ func readelfsym(elfobj *ElfObj, i int, sym *ElfSym, needSym int) (err error) {
sym.other = b.Other
}
var s *LSym
var s *Symbol
if sym.name == "_GLOBAL_OFFSET_TABLE_" {
sym.name = ".got"
}
......
......@@ -92,7 +92,7 @@ type LdMachoSect struct {
flags uint32
res1 uint32
res2 uint32
sym *LSym
sym *Symbol
rel []LdMachoRel
}
......@@ -123,7 +123,7 @@ type LdMachoSym struct {
desc uint16
kind int8
value uint64
sym *LSym
sym *Symbol
}
type LdMachoDysymtab struct {
......@@ -433,9 +433,9 @@ func ldmacho(f *bio.Reader, pkg string, length int64, pn string) {
var sect *LdMachoSect
var rel *LdMachoRel
var rpi int
var s *LSym
var s1 *LSym
var outer *LSym
var s *Symbol
var s1 *Symbol
var outer *Symbol
var c *LdMachoCmd
var symtab *LdMachoSymtab
var dsymtab *LdMachoDysymtab
......
......@@ -107,14 +107,14 @@ type PeSym struct {
type_ uint16
sclass uint8
aux uint8
sym *LSym
sym *Symbol
}
type PeSect struct {
name string
base []byte
size uint64
sym *LSym
sym *Symbol
sh IMAGE_SECTION_HEADER
}
......@@ -153,7 +153,7 @@ func ldpe(f *bio.Reader, pkg string, length int64, pn string) {
var r []Reloc
var rp *Reloc
var rsect *PeSect
var s *LSym
var s *Symbol
var sym *PeSym
var symbuf [18]uint8
if err = binary.Read(f, binary.LittleEndian, &peobj.fh); err != nil {
......@@ -502,7 +502,7 @@ func readpesym(peobj *PeObj, i int, y **PeSym) (err error) {
name = name[:i]
}
var s *LSym
var s *Symbol
switch sym.type_ {
default:
err = fmt.Errorf("%s: invalid symbol type %d", sym.name, sym.type_)
......
......@@ -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
......
......@@ -37,7 +37,8 @@ import (
"fmt"
)
type LSym struct {
// Symbol is an entry in the symbol table.
type Symbol struct {
Name string
Extname string
Type int16
......@@ -56,28 +57,29 @@ type LSym struct {
// is not set for symbols defined by the packages being linked or by symbols
// read by ldelf (and so is left as elf.STT_NOTYPE).
ElfType elf.SymType
Next *LSym
Sub *LSym
Outer *LSym
Gotype *LSym
Reachparent *LSym
Next *Symbol
Sub *Symbol
Outer *Symbol
Gotype *Symbol
Reachparent *Symbol
File string
Dynimplib string
Dynimpvers string
Sect *Section
FuncInfo *FuncInfo
P []byte
R []Reloc
// P contains the raw symbol data.
P []byte
R []Reloc
}
func (s *LSym) String() string {
func (s *Symbol) String() string {
if s.Version == 0 {
return s.Name
}
return fmt.Sprintf("%s<%d>", s.Name, s.Version)
}
func (s *LSym) ElfsymForReloc() int32 {
func (s *Symbol) ElfsymForReloc() int32 {
// If putelfsym created a local version of this symbol, use that in all
// relocations.
if s.LocalElfsym != 0 {
......@@ -138,13 +140,13 @@ type Reloc struct {
Variant int32
Add int64
Xadd int64
Sym *LSym
Xsym *LSym
Sym *Symbol
Xsym *Symbol
}
type Auto struct {
Asym *LSym
Gotype *LSym
Asym *Symbol
Gotype *Symbol
Aoffset int32
Name int16
}
......@@ -154,7 +156,7 @@ type Shlib struct {
Hash []byte
Deps []string
File *elf.File
gcdata_addresses map[*LSym]uint64
gcdata_addresses map[*Symbol]uint64
}
type Link struct {
......@@ -167,21 +169,21 @@ type Link struct {
Goroot string
// Symbol lookup based on name and indexed by version.
Hash []map[string]*LSym
Hash []map[string]*Symbol
Allsym []*LSym
Tlsg *LSym
Allsym []*Symbol
Tlsg *Symbol
Libdir []string
Library []*Library
Shlibs []Shlib
Tlsoffset int
Diag func(string, ...interface{})
Cursym *LSym
Cursym *Symbol
Version int
Textp []*LSym
Filesyms []*LSym
Moduledata *LSym
LSymBatch []LSym
Textp []*Symbol
Filesyms []*Symbol
Moduledata *Symbol
LSymBatch []Symbol
}
// The smallest possible offset from the hardware stack pointer to a local
......@@ -203,7 +205,7 @@ func (ctxt *Link) FixedFrameSize() int64 {
func (l *Link) IncVersion() {
l.Version++
l.Hash = append(l.Hash, make(map[string]*LSym))
l.Hash = append(l.Hash, make(map[string]*Symbol))
}
type Library struct {
......@@ -223,9 +225,9 @@ type FuncInfo struct {
Pcfile Pcdata
Pcline Pcdata
Pcdata []Pcdata
Funcdata []*LSym
Funcdata []*Symbol
Funcdataoff []int64
File []*LSym
File []*Symbol
}
type Pcdata struct {
......
......@@ -121,7 +121,7 @@ const (
var nkind [NumSymKind]int
var sortsym []*LSym
var sortsym []*Symbol
var nsortsym int
......@@ -602,7 +602,7 @@ func Asmbmacho() {
}
}
func symkind(s *LSym) int {
func symkind(s *Symbol) int {
if s.Type == obj.SDYNIMPORT {
return SymKindUndef
}
......@@ -612,7 +612,7 @@ func symkind(s *LSym) int {
return SymKindLocal
}
func addsym(s *LSym, name string, type_ int, addr int64, size int64, ver int, gotype *LSym) {
func addsym(s *Symbol, name string, type_ int, addr int64, size int64, ver int, gotype *Symbol) {
if s == nil {
return
}
......@@ -633,7 +633,7 @@ func addsym(s *LSym, name string, type_ int, addr int64, size int64, ver int, go
nsortsym++
}
type machoscmp []*LSym
type machoscmp []*Symbol
func (x machoscmp) Len() int {
return len(x)
......@@ -656,7 +656,7 @@ func (x machoscmp) Less(i, j int) bool {
return s1.Extname < s2.Extname
}
func machogenasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
func machogenasmsym(put func(*Symbol, string, int, int64, int64, int, *Symbol)) {
genasmsym(put)
for _, s := range Ctxt.Allsym {
if s.Type == obj.SDYNIMPORT || s.Type == obj.SHOSTOBJ {
......@@ -675,7 +675,7 @@ func machosymorder() {
dynexp[i].Attr |= AttrReachable
}
machogenasmsym(addsym)
sortsym = make([]*LSym, nsortsym)
sortsym = make([]*Symbol, nsortsym)
nsortsym = 0
machogenasmsym(addsym)
sort.Sort(machoscmp(sortsym[:nsortsym]))
......@@ -809,7 +809,7 @@ func Domacholink() int64 {
return Rnd(int64(size), int64(INITRND))
}
func machorelocsect(sect *Section, syms []*LSym) {
func machorelocsect(sect *Section, syms []*Symbol) {
// If main section has no bits, nothing to relocate.
if sect.Vaddr >= sect.Seg.Vaddr+sect.Seg.Filelen {
return
......
......@@ -135,19 +135,19 @@ type objReader struct {
pkg string
pn string
// List of symbol references for the file being read.
dupSym *LSym
dupSym *Symbol
// rdBuf is used by readString and readSymName as scratch for reading strings.
rdBuf []byte
refs []*LSym
refs []*Symbol
data []byte
reloc []Reloc
pcdata []Pcdata
autom []Auto
funcdata []*LSym
funcdata []*Symbol
funcdataoff []int64
file []*LSym
file []*Symbol
}
func LoadObjFile(ctxt *Link, f *bio.Reader, pkg string, length int64, pn string) {
......@@ -157,7 +157,7 @@ func LoadObjFile(ctxt *Link, f *bio.Reader, pkg string, length int64, pn string)
pkg: pkg,
ctxt: ctxt,
pn: pn,
dupSym: &LSym{Name: ".dup"},
dupSym: &Symbol{Name: ".dup"},
}
r.loadObjFile()
if f.Offset() != start+length {
......@@ -192,7 +192,7 @@ func (r *objReader) loadObjFile() {
}
// Symbol references
r.refs = []*LSym{nil} // zeroth ref is nil
r.refs = []*Symbol{nil} // zeroth ref is nil
for {
c, err := r.rd.Peek(1)
if err != nil {
......@@ -241,10 +241,10 @@ func (r *objReader) readSlices() {
n = r.readInt()
r.autom = make([]Auto, n)
n = r.readInt()
r.funcdata = make([]*LSym, n)
r.funcdata = make([]*Symbol, n)
r.funcdataoff = make([]int64, n)
n = r.readInt()
r.file = make([]*LSym, n)
r.file = make([]*Symbol, n)
}
// Symbols are prefixed so their content doesn't get confused with the magic footer.
......@@ -265,7 +265,7 @@ func (r *objReader) readSym() {
nreloc := r.readInt()
isdup := false
var dup *LSym
var dup *Symbol
if s.Type != 0 && s.Type != obj.SXREF {
if (t == obj.SDATA || t == obj.SBSS || t == obj.SNOPTRBSS) && len(data) == 0 && nreloc == 0 {
if s.Size < int64(size) {
......@@ -407,7 +407,7 @@ overwrite:
}
}
func (r *objReader) patchDWARFName(s *LSym) {
func (r *objReader) patchDWARFName(s *Symbol) {
// This is kind of ugly. Really the package name should not
// even be included here.
if s.Size < 1 || s.P[0] != dwarf.DW_ABRV_FUNCTION {
......@@ -618,7 +618,7 @@ func (r *objReader) readSymName() string {
}
// Reads the index of a symbol reference and resolves it to a symbol
func (r *objReader) readSymIndex() *LSym {
func (r *objReader) readSymIndex() *Symbol {
i := r.readInt()
return r.refs[i]
}
......@@ -123,7 +123,7 @@ func addvarint(d *Pcdata, val uint32) {
p[0] = byte(v)
}
func addpctab(ftab *LSym, off int32, d *Pcdata) int32 {
func addpctab(ftab *Symbol, off int32, d *Pcdata) int32 {
var start int32
if len(d.P) > 0 {
start = int32(len(ftab.P))
......@@ -132,7 +132,7 @@ func addpctab(ftab *LSym, off int32, d *Pcdata) int32 {
return int32(setuint32(Ctxt, ftab, int64(off), uint32(start)))
}
func ftabaddstring(ftab *LSym, s string) int32 {
func ftabaddstring(ftab *Symbol, s string) int32 {
n := int32(len(s)) + 1
start := int32(len(ftab.P))
Symgrow(Ctxt, ftab, int64(start)+int64(n)+1)
......@@ -140,8 +140,8 @@ func ftabaddstring(ftab *LSym, s string) int32 {
return start
}
func renumberfiles(ctxt *Link, files []*LSym, d *Pcdata) {
var f *LSym
func renumberfiles(ctxt *Link, files []*Symbol, d *Pcdata) {
var f *Symbol
// Give files numbers.
for i := 0; i < len(files); i++ {
......@@ -186,7 +186,7 @@ func renumberfiles(ctxt *Link, files []*LSym, d *Pcdata) {
*d = out
}
func container(s *LSym) int {
func container(s *Symbol) int {
// We want to generate func table entries only for the "lowest level" symbols,
// not containers of subsymbols.
if s != nil && s.Type&obj.SCONTAINER != 0 {
......@@ -204,8 +204,8 @@ var pclntab_zpcln FuncInfo
var pclntabNfunc int32
var pclntabFiletabOffset int32
var pclntabPclntabOffset int32
var pclntabFirstFunc *LSym
var pclntabLastFunc *LSym
var pclntabFirstFunc *Symbol
var pclntabLastFunc *Symbol
func pclntab() {
funcdata_bytes := int64(0)
......@@ -243,7 +243,7 @@ func pclntab() {
pclntabPclntabOffset = int32(8 + SysArch.PtrSize)
nfunc = 0
var last *LSym
var last *Symbol
for _, Ctxt.Cursym = range Ctxt.Textp {
last = Ctxt.Cursym
if container(Ctxt.Cursym) != 0 {
......@@ -420,7 +420,7 @@ func findfunctab() {
continue
}
p := s.Value
var e *LSym
var e *Symbol
i++
if i < len(Ctxt.Textp) {
e = Ctxt.Textp[i]
......
......@@ -324,7 +324,7 @@ var dosstub = []uint8{
0x00,
}
var rsrcsym *LSym
var rsrcsym *Symbol
var strtbl []byte
......@@ -357,7 +357,7 @@ var sh [16]IMAGE_SECTION_HEADER
var dd []IMAGE_DATA_DIRECTORY
type Imp struct {
s *LSym
s *Symbol
off uint64
next *Imp
argsize int
......@@ -373,7 +373,7 @@ type Dll struct {
var dr *Dll
var dexport [1024]*LSym
var dexport [1024]*Symbol
var nexport int
......@@ -674,7 +674,7 @@ func addimports(datsect *IMAGE_SECTION_HEADER) {
Cseek(endoff)
}
type byExtname []*LSym
type byExtname []*Symbol
func (s byExtname) Len() int { return len(s) }
func (s byExtname) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
......@@ -764,7 +764,7 @@ func addexports() {
// perelocsect relocates symbols from first in section sect, and returns
// the total number of relocations emitted.
func perelocsect(sect *Section, syms []*LSym) int {
func perelocsect(sect *Section, syms []*Symbol) int {
// If main section has no bits, nothing to relocate.
if sect.Vaddr >= sect.Seg.Vaddr+sect.Seg.Filelen {
return 0
......@@ -931,7 +931,7 @@ func newPEDWARFSection(name string, size int64) *IMAGE_SECTION_HEADER {
func writePESymTableRecords() int {
var symcnt int
put := func(s *LSym, name string, type_ int, addr int64, size int64, ver int, gotype *LSym) {
put := func(s *Symbol, name string, type_ int, addr int64, size int64, ver int, gotype *Symbol) {
if s == nil {
return
}
......@@ -1048,7 +1048,7 @@ func addpesymtable() {
}
}
func setpersrc(sym *LSym) {
func setpersrc(sym *Symbol) {
if rsrcsym != nil {
Diag("too many .rsrc sections")
}
......
......@@ -58,12 +58,12 @@ var headers = []struct {
func linknew(arch *sys.Arch) *Link {
ctxt := &Link{
Hash: []map[string]*LSym{
Hash: []map[string]*Symbol{
// preallocate about 2mb for hash of
// non static symbols
make(map[string]*LSym, 100000),
make(map[string]*Symbol, 100000),
},
Allsym: make([]*LSym, 0, 100000),
Allsym: make([]*Symbol, 0, 100000),
Arch: arch,
Goroot: obj.Getgoroot(),
}
......@@ -160,10 +160,10 @@ func linknew(arch *sys.Arch) *Link {
return ctxt
}
func linknewsym(ctxt *Link, name string, v int) *LSym {
func linknewsym(ctxt *Link, name string, v int) *Symbol {
batch := ctxt.LSymBatch
if len(batch) == 0 {
batch = make([]LSym, 1000)
batch = make([]Symbol, 1000)
}
s := &batch[0]
ctxt.LSymBatch = batch[1:]
......@@ -178,7 +178,7 @@ func linknewsym(ctxt *Link, name string, v int) *LSym {
return s
}
func Linklookup(ctxt *Link, name string, v int) *LSym {
func Linklookup(ctxt *Link, name string, v int) *Symbol {
m := ctxt.Hash[v]
s := m[name]
if s != nil {
......@@ -191,7 +191,7 @@ func Linklookup(ctxt *Link, name string, v int) *LSym {
}
// read-only lookup
func Linkrlookup(ctxt *Link, name string, v int) *LSym {
func Linkrlookup(ctxt *Link, name string, v int) *Symbol {
return ctxt.Hash[v][name]
}
......
......@@ -84,7 +84,7 @@ var numelfsym int = 1 // 0 is reserved
var elfbind int
func putelfsym(x *LSym, s string, t int, addr int64, size int64, ver int, go_ *LSym) {
func putelfsym(x *Symbol, s string, t int, addr int64, size int64, ver int, go_ *Symbol) {
var type_ int
switch t {
......@@ -184,7 +184,7 @@ func putelfsym(x *LSym, s string, t int, addr int64, size int64, ver int, go_ *L
numelfsym++
}
func putelfsectionsym(s *LSym, shndx int) {
func putelfsectionsym(s *Symbol, shndx int) {
putelfsyment(0, 0, 0, STB_LOCAL<<4|STT_SECTION, shndx, 0)
s.Elfsym = int32(numelfsym)
numelfsym++
......@@ -211,7 +211,7 @@ func Asmelfsym() {
genasmsym(putelfsym)
}
func putplan9sym(x *LSym, s string, t int, addr int64, size int64, ver int, go_ *LSym) {
func putplan9sym(x *Symbol, s string, t int, addr int64, size int64, ver int, go_ *Symbol) {
switch t {
case 'T', 'L', 'D', 'B':
if ver != 0 {
......@@ -267,7 +267,7 @@ func Asmplan9sym() {
genasmsym(putplan9sym)
}
var symt *LSym
var symt *Symbol
var encbuf [10]byte
......@@ -360,8 +360,8 @@ func symtab() {
xdefine("runtime.egcbss", obj.SRODATA, 0)
// pseudo-symbols to mark locations of type, string, and go string data.
var symtype *LSym
var symtyperel *LSym
var symtype *Symbol
var symtyperel *Symbol
if UseRelro() && (Buildmode == BuildmodeCShared || Buildmode == BuildmodePIE) {
s = Linklookup(Ctxt, "type.*", 0)
......@@ -386,7 +386,7 @@ func symtab() {
symtyperel = s
}
groupSym := func(name string, t int16) *LSym {
groupSym := func(name string, t int16) *Symbol {
s := Linklookup(Ctxt, name, 0)
s.Type = t
s.Size = 0
......
......@@ -40,7 +40,7 @@ import (
func gentext() {}
func adddynrel(s *ld.LSym, r *ld.Reloc) {
func adddynrel(s *ld.Symbol, r *ld.Reloc) {
log.Fatalf("adddynrel not implemented")
}
......@@ -101,7 +101,7 @@ func machoreloc1(r *ld.Reloc, sectoff int64) int {
return -1
}
func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
func archreloc(r *ld.Reloc, s *ld.Symbol, val *int64) int {
if ld.Linkmode == ld.LinkExternal {
switch r.Type {
default:
......@@ -178,7 +178,7 @@ func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
return -1
}
func archrelocvariant(r *ld.Reloc, s *ld.LSym, t int64) int64 {
func archrelocvariant(r *ld.Reloc, s *ld.Symbol, t int64) int64 {
return -1
}
......
......@@ -196,7 +196,7 @@ func gentext() {
// Construct a call stub in stub that calls symbol targ via its PLT
// entry.
func gencallstub(abicase int, stub *ld.LSym, targ *ld.LSym) {
func gencallstub(abicase int, stub *ld.Symbol, targ *ld.Symbol) {
if abicase != 1 {
// If we see R_PPC64_TOCSAVE or R_PPC64_REL24_NOTOC
// relocations, we'll need to implement cases 2 and 3.
......@@ -240,7 +240,7 @@ func gencallstub(abicase int, stub *ld.LSym, targ *ld.LSym) {
ld.Adduint32(ld.Ctxt, stub, 0x4e800420) // bctr
}
func adddynrel(s *ld.LSym, r *ld.Reloc) {
func adddynrel(s *ld.Symbol, r *ld.Reloc) {
targ := r.Sym
ld.Ctxt.Cursym = s
......@@ -448,8 +448,8 @@ func machoreloc1(r *ld.Reloc, sectoff int64) int {
}
// Return the value of .TOC. for symbol s
func symtoc(s *ld.LSym) int64 {
var toc *ld.LSym
func symtoc(s *ld.Symbol) int64 {
var toc *ld.Symbol
if s.Outer != nil {
toc = ld.Linkrlookup(ld.Ctxt, ".TOC.", int(s.Outer.Version))
......@@ -465,7 +465,7 @@ func symtoc(s *ld.LSym) int64 {
return toc.Value
}
func archrelocaddr(r *ld.Reloc, s *ld.LSym, val *int64) int {
func archrelocaddr(r *ld.Reloc, s *ld.Symbol, val *int64) int {
var o1, o2 uint32
if ld.Ctxt.Arch.ByteOrder == binary.BigEndian {
o1 = uint32(*val >> 32)
......@@ -514,7 +514,7 @@ func archrelocaddr(r *ld.Reloc, s *ld.LSym, val *int64) int {
return 0
}
func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
func archreloc(r *ld.Reloc, s *ld.Symbol, val *int64) int {
if ld.Linkmode == ld.LinkExternal {
switch r.Type {
default:
......@@ -607,7 +607,7 @@ func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
return -1
}
func archrelocvariant(r *ld.Reloc, s *ld.LSym, t int64) int64 {
func archrelocvariant(r *ld.Reloc, s *ld.Symbol, t int64) int64 {
switch r.Variant & ld.RV_TYPE_MASK {
default:
ld.Diag("unexpected relocation variant %d", r.Variant)
......@@ -698,7 +698,7 @@ overflow:
return t
}
func addpltsym(ctxt *ld.Link, s *ld.LSym) {
func addpltsym(ctxt *ld.Link, s *ld.Symbol) {
if s.Plt >= 0 {
return
}
......@@ -744,7 +744,7 @@ func addpltsym(ctxt *ld.Link, s *ld.LSym) {
}
// Generate the glink resolver stub if necessary and return the .glink section
func ensureglinkresolver() *ld.LSym {
func ensureglinkresolver() *ld.Symbol {
glink := ld.Linklookup(ld.Ctxt, ".glink", 0)
if glink.Size != 0 {
return glink
......
......@@ -98,7 +98,7 @@ func gentext() {
ld.Addaddr(ld.Ctxt, initarray_entry, initfunc)
}
func adddynrel(s *ld.LSym, r *ld.Reloc) {
func adddynrel(s *ld.Symbol, r *ld.Reloc) {
targ := r.Sym
ld.Ctxt.Cursym = s
......@@ -380,7 +380,7 @@ func machoreloc1(r *ld.Reloc, sectoff int64) int {
return -1
}
func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
func archreloc(r *ld.Reloc, s *ld.Symbol, val *int64) int {
if ld.Linkmode == ld.LinkExternal {
return -1
}
......@@ -398,7 +398,7 @@ func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
return -1
}
func archrelocvariant(r *ld.Reloc, s *ld.LSym, t int64) int64 {
func archrelocvariant(r *ld.Reloc, s *ld.Symbol, t int64) int64 {
switch r.Variant & ld.RV_TYPE_MASK {
default:
ld.Diag("unexpected relocation variant %d", r.Variant)
......@@ -415,7 +415,7 @@ func archrelocvariant(r *ld.Reloc, s *ld.LSym, t int64) int64 {
}
}
func addpltsym(ctxt *ld.Link, s *ld.LSym) {
func addpltsym(ctxt *ld.Link, s *ld.Symbol) {
if s.Plt >= 0 {
return
}
......@@ -478,7 +478,7 @@ func addpltsym(ctxt *ld.Link, s *ld.LSym) {
}
}
func addgotsym(s *ld.LSym) {
func addgotsym(s *ld.Symbol) {
if s.Got >= 0 {
return
}
......
......@@ -38,7 +38,7 @@ import (
)
// Append 4 bytes to s and create a R_CALL relocation targeting t to fill them in.
func addcall(ctxt *ld.Link, s *ld.LSym, t *ld.LSym) {
func addcall(ctxt *ld.Link, s *ld.Symbol, t *ld.Symbol) {
s.Attr |= ld.AttrReachable
i := s.Size
s.Size += 4
......@@ -149,7 +149,7 @@ func gentext() {
ld.Addaddr(ld.Ctxt, initarray_entry, initfunc)
}
func adddynrel(s *ld.LSym, r *ld.Reloc) {
func adddynrel(s *ld.Symbol, r *ld.Reloc) {
targ := r.Sym
ld.Ctxt.Cursym = s
......@@ -483,7 +483,7 @@ func pereloc1(r *ld.Reloc, sectoff int64) bool {
return true
}
func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
func archreloc(r *ld.Reloc, s *ld.Symbol, val *int64) int {
if ld.Linkmode == ld.LinkExternal {
return -1
}
......@@ -500,7 +500,7 @@ func archreloc(r *ld.Reloc, s *ld.LSym, val *int64) int {
return -1
}
func archrelocvariant(r *ld.Reloc, s *ld.LSym, t int64) int64 {
func archrelocvariant(r *ld.Reloc, s *ld.Symbol, t int64) int64 {
log.Fatalf("unexpected relocation variant")
return t
}
......@@ -532,7 +532,7 @@ func elfsetupplt() {
}
}
func addpltsym(ctxt *ld.Link, s *ld.LSym) {
func addpltsym(ctxt *ld.Link, s *ld.Symbol) {
if s.Plt >= 0 {
return
}
......@@ -592,7 +592,7 @@ func addpltsym(ctxt *ld.Link, s *ld.LSym) {
}
}
func addgotsym(ctxt *ld.Link, s *ld.LSym) {
func addgotsym(ctxt *ld.Link, s *ld.Symbol) {
if s.Got >= 0 {
return
}
......
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