Skip to content

Commit 3494a72

Browse files
committed
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 <[email protected]> Reviewed-by: Than McIntosh <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent 39ca989 commit 3494a72

File tree

1 file changed

+1
-1
lines changed
  • src/cmd/compile/internal/gc

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ func dumpGlobal(n *ir.Name) {
195195
}
196196
types.CalcSize(n.Type())
197197
ggloblnod(n)
198-
if n.CoverageCounter() || n.CoverageAuxVar() {
198+
if n.CoverageCounter() || n.CoverageAuxVar() || n.Linksym().Static() {
199199
return
200200
}
201201
base.Ctxt.DwarfGlobal(base.Ctxt.Pkgpath, types.TypeSymName(n.Type()), n.Linksym())

0 commit comments

Comments
 (0)