Commit c2b4fb5a authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

cmd/compile: eliminate some Linksym calls in obj.go

Passes toolstash-check.

Change-Id: I0cb2ea9ca7ec2449999af28457270ff7b3324e92
Reviewed-on: https://go-review.googlesource.com/41410
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
parent 3cf72322
...@@ -221,9 +221,9 @@ func dumpglobls() { ...@@ -221,9 +221,9 @@ func dumpglobls() {
} }
for _, s := range funcsyms { for _, s := range funcsyms {
sf := s.Pkg.Lookup(funcsymname(s)) sf := s.Pkg.Lookup(funcsymname(s)).Linksym()
dsymptr(sf.Linksym(), 0, s.Linksym(), 0) dsymptr(sf, 0, s.Linksym(), 0)
ggloblsym(sf.Linksym(), int32(Widthptr), obj.DUPOK|obj.RODATA) ggloblsym(sf, int32(Widthptr), obj.DUPOK|obj.RODATA)
} }
// Do not reprocess funcsyms on next dumpglobls call. // Do not reprocess funcsyms on next dumpglobls call.
...@@ -324,16 +324,18 @@ func slicebytes(nam *Node, s string, len int) { ...@@ -324,16 +324,18 @@ func slicebytes(nam *Node, s string, len int) {
sym := localpkg.Lookup(symname) sym := localpkg.Lookup(symname)
sym.Def = asTypesNode(newname(sym)) sym.Def = asTypesNode(newname(sym))
off := dsname(sym.Linksym(), 0, s) lsym := sym.Linksym()
ggloblsym(sym.Linksym(), int32(off), obj.NOPTR|obj.LOCAL) off := dsname(lsym, 0, s)
ggloblsym(lsym, int32(off), obj.NOPTR|obj.LOCAL)
if nam.Op != ONAME { if nam.Op != ONAME {
Fatalf("slicebytes %v", nam) Fatalf("slicebytes %v", nam)
} }
nsym := nam.Sym.Linksym()
off = int(nam.Xoffset) off = int(nam.Xoffset)
off = dsymptr(nam.Sym.Linksym(), off, sym.Linksym(), 0) off = dsymptr(nsym, off, lsym, 0)
off = duintptr(nam.Sym.Linksym(), off, uint64(len)) off = duintptr(nsym, off, uint64(len))
duintptr(nam.Sym.Linksym(), off, uint64(len)) duintptr(nsym, off, uint64(len))
} }
func dsname(s *obj.LSym, off int, t string) int { func dsname(s *obj.LSym, off int, t string) int {
......
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