From f79a983891123f57dd7d37d09a51a287ac6d4cad Mon Sep 17 00:00:00 2001 From: MoZhonghua Date: Fri, 17 Dec 2021 06:53:21 +0000 Subject: [PATCH] cmd/link: don't generate typedef DWARF entry for noalg.struct{...} cmd/compile uses "noalg.struct {...}" as type name when hash and eq algorithm generation of this struct type is suppressed. This should be treated as normal struct type, that is, link shouldn't generate DW_TAG_typedef DIE for it. Change-Id: Ifada8a818bcfa2e5615f85ead9582cead923b86c GitHub-Last-Rev: 15de3e4a846fcd79e231384539be20b06197b826 GitHub-Pull-Request: golang/go#50237 Reviewed-on: https://go-review.googlesource.com/c/go/+/373054 Reviewed-by: Than McIntosh Reviewed-by: Cherry Mui Run-TryBot: Cherry Mui TryBot-Result: Gopher Robot --- src/cmd/link/internal/ld/dwarf.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/cmd/link/internal/ld/dwarf.go b/src/cmd/link/internal/ld/dwarf.go index 47b4921cd8..4aaed7baf0 100644 --- a/src/cmd/link/internal/ld/dwarf.go +++ b/src/cmd/link/internal/ld/dwarf.go @@ -471,6 +471,11 @@ func (d *dwctxt) dotypedef(parent *dwarf.DWDie, name string, def *dwarf.DWDie) * if strings.HasPrefix(name, "struct {") { return nil } + // cmd/compile uses "noalg.struct {...}" as type name when hash and eq algorithm generation of + // this struct type is suppressed. + if strings.HasPrefix(name, "noalg.struct {") { + return nil + } if strings.HasPrefix(name, "chan ") { return nil } -- 2.50.0