From 3494a726009d049887bb3fb95181f71e07b21da3 Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Fri, 28 Apr 2023 22:15:48 -0400 Subject: [PATCH] cmd/compile: don't generate DWARF info for static vars 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 Reviewed-by: Than McIntosh TryBot-Result: Gopher Robot --- src/cmd/compile/internal/gc/obj.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/compile/internal/gc/obj.go b/src/cmd/compile/internal/gc/obj.go index 504072bb173b7..e895c452f2008 100644 --- a/src/cmd/compile/internal/gc/obj.go +++ b/src/cmd/compile/internal/gc/obj.go @@ -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())