For GC mask symbols, we don't need to create types.Sym, just the
LSym.
Change-Id: I285b518cfd60bfaa3202a02b3005a7122daeb338
Reviewed-on: https://go-review.googlesource.com/c/go/+/313512
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
func dgcptrmask(t *types.Type) *obj.LSym {
ptrmask := make([]byte, (types.PtrDataSize(t)/int64(types.PtrSize)+7)/8)
fillptrmask(t, ptrmask)
- p := fmt.Sprintf("gcbits.%x", ptrmask)
+ p := fmt.Sprintf("runtime.gcbits.%x", ptrmask)
- sym := ir.Pkgs.Runtime.Lookup(p)
- lsym := sym.Linksym()
- if !sym.Uniq() {
- sym.SetUniq(true)
+ lsym := base.Ctxt.Lookup(p)
+ if !lsym.OnList() {
for i, x := range ptrmask {
objw.Uint8(lsym, i, x)
}