]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link: don't generate typedef DWARF entry for noalg.struct{...}
authorMoZhonghua <Kasulle@gmail.com>
Fri, 17 Dec 2021 06:53:21 +0000 (06:53 +0000)
committerCherry Mui <cherryyz@google.com>
Wed, 2 Mar 2022 16:54:21 +0000 (16:54 +0000)
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 <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/link/internal/ld/dwarf.go

index 47b4921cd8fe6f58290330cf9769e93151951455..4aaed7baf04ff18d90e46de3171342b5e077936e 100644 (file)
@@ -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
        }