]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: skip types.Sym for GC mask symbols
authorCherry Zhang <cherryyz@google.com>
Sat, 24 Apr 2021 02:30:38 +0000 (22:30 -0400)
committerCherry Zhang <cherryyz@google.com>
Thu, 29 Apr 2021 23:31:23 +0000 (23:31 +0000)
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>
src/cmd/compile/internal/reflectdata/reflect.go

index 26b08ee08a2a15248b6abc349c7ccb7320a0277f..836174d0ceac213d8f6efe8ab7a106b70f572067 100644 (file)
@@ -1509,12 +1509,10 @@ func dgcsym(t *types.Type) (lsym *obj.LSym, useGCProg bool, ptrdata int64) {
 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)
                }