Skip to content

Commit

Permalink
cmd/compile: don't generate DWARF info for static vars
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cherrymui committed May 2, 2023
1 parent 39ca989 commit 3494a72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/compile/internal/gc/obj.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit 3494a72

Please sign in to comment.