]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: don't generate DWARF info for static vars
authorCherry Mui <cherryyz@google.com>
Sat, 29 Apr 2023 02:15:48 +0000 (22:15 -0400)
committerCherry Mui <cherryyz@google.com>
Tue, 2 May 2023 12:53:37 +0000 (12:53 +0000)
Static data symbols are compiler generated, not user symbols. The
linker already does not include them in the final DWARF section.
Don't generate the DWARF info in the first place.

Change-Id: Id2ae36683bfc1ed60b9924b7305eae5e8aa14d80
Reviewed-on: https://go-review.googlesource.com/c/go/+/490817
Run-TryBot: Cherry Mui <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/compile/internal/gc/obj.go

index 504072bb173b7d0a78b5d06ebd8b49656116aec7..e895c452f2008398931da72f627116b4823d19bb 100644 (file)
@@ -195,7 +195,7 @@ func dumpGlobal(n *ir.Name) {
        }
        types.CalcSize(n.Type())
        ggloblnod(n)
-       if n.CoverageCounter() || n.CoverageAuxVar() {
+       if n.CoverageCounter() || n.CoverageAuxVar() || n.Linksym().Static() {
                return
        }
        base.Ctxt.DwarfGlobal(base.Ctxt.Pkgpath, types.TypeSymName(n.Type()), n.Linksym())