mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.link] cmd/link: remove elf sym fields from sym.Symbol
Remove the "ElfSym" and "LocalElfSym" fields from sym.Symbol, replacing uses with loader method calls as needed. Change-Id: I3828f13203ece2bdc03eeb09ab37a5c94e21a726 Reviewed-on: https://go-review.googlesource.com/c/go/+/230462 Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
parent
3f408fc7fd
commit
0722a49b37
13 changed files with 38 additions and 38 deletions
|
|
@ -2918,6 +2918,17 @@ func symPkg(ctxt *Link, s *sym.Symbol) string {
|
|||
return ctxt.loader.SymPkg(loader.Sym(s.SymIdx))
|
||||
}
|
||||
|
||||
func ElfSymForReloc(ctxt *Link, s *sym.Symbol) int32 {
|
||||
// If putelfsym created a local version of this symbol, use that in all
|
||||
// relocations.
|
||||
les := ctxt.loader.SymLocalElfSym(loader.Sym(s.SymIdx))
|
||||
if les != 0 {
|
||||
return les
|
||||
} else {
|
||||
return ctxt.loader.SymElfSym(loader.Sym(s.SymIdx))
|
||||
}
|
||||
}
|
||||
|
||||
func (ctxt *Link) dumpsyms() {
|
||||
for _, s := range ctxt.loader.Syms {
|
||||
if s == nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue