// so that they can be de-duplicated.
// This provides significant binary size savings.
// It is safe to rename these LSyms because
- // they are tracked separately from ctxt.Hash.
+ // they are tracked separately from ctxt.hash.
argssym.Name = fmt.Sprintf("gclocals·%x", md5.Sum(argssym.P))
livesym.Name = fmt.Sprintf("gclocals·%x", md5.Sum(livesym.P))
}
func TestLinkgetlineFromPos(t *testing.T) {
ctxt := new(Link)
- ctxt.Hash = make(map[SymVer]*LSym)
+ ctxt.hash = make(map[SymVer]*LSym)
afile := src.NewFileBase("a.go", "a.go")
bfile := src.NewFileBase("b.go", "/foo/bar/b.go")
func Linknew(arch *LinkArch) *Link {
ctxt := new(Link)
- ctxt.Hash = make(map[SymVer]*LSym)
+ ctxt.hash = make(map[SymVer]*LSym)
ctxt.Arch = arch
ctxt.Pathname = WorkingDir()
// LookupInit looks up the symbol with name name and version v.
// If it does not exist, it creates it and passes it to initfn for one-time initialization.
func (ctxt *Link) LookupInit(name string, v int, init func(s *LSym)) *LSym {
- s := ctxt.Hash[SymVer{name, v}]
+ s := ctxt.hash[SymVer{name, v}]
if s != nil {
return s
}
s = &LSym{Name: name, Version: int16(v)}
- ctxt.Hash[SymVer{name, v}] = s
+ ctxt.hash[SymVer{name, v}] = s
if init != nil {
init(s)
}