]> Cypherpunks repositories - gostls13.git/commitdiff
[dev.link] cmd/link: fix buglet in new GCProg generation code
authorCherry Zhang <cherryyz@google.com>
Fri, 24 Apr 2020 19:19:55 +0000 (15:19 -0400)
committerCherry Zhang <cherryyz@google.com>
Sat, 25 Apr 2020 01:20:55 +0000 (01:20 +0000)
It should check the name of the symbol being added, not the
GC data symbol we're generating.

Change-Id: I123679778ee542b8d1f5c15bf090fa3578025c19
Reviewed-on: https://go-review.googlesource.com/c/go/+/230018
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/link/internal/ld/data.go

index d5286b428943e47ed435085702489c734dfff19b..2022c43bff55c65f67beff77f45faf792d03f48a 100644 (file)
@@ -1084,14 +1084,14 @@ func (p *GCProg2) AddSym(s loader.Sym) {
        // Things without pointers should be in sym.SNOPTRDATA or sym.SNOPTRBSS;
        // everything we see should have pointers and should therefore have a type.
        if typ == 0 {
-               switch p.sym.Name() {
+               switch ldr.SymName(s) {
                case "runtime.data", "runtime.edata", "runtime.bss", "runtime.ebss":
                        // Ignore special symbols that are sometimes laid out
                        // as real symbols. See comment about dyld on darwin in
                        // the address function.
                        return
                }
-               p.ctxt.Errorf(p.sym.Sym(), "missing Go type information for global symbol: size %d", ldr.SymSize(s))
+               p.ctxt.Errorf(p.sym.Sym(), "missing Go type information for global symbol %s: size %d", ldr.SymName(s), ldr.SymSize(s))
                return
        }