]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/dwarfgen: fix DWARF param DIE ordering
authorThan McIntosh <thanm@google.com>
Tue, 11 May 2021 15:29:27 +0000 (11:29 -0400)
committerThan McIntosh <thanm@google.com>
Thu, 13 May 2021 14:30:42 +0000 (14:30 +0000)
commitfd4631e24f53cf836a67b00e82e2159854ec31d0
tree8346620914ca381775dee01d279afe767fd5cf4b
parenta63cded5e413ffad1ec8088ef7abd10abb7b5252
cmd/compile/internal/dwarfgen: fix DWARF param DIE ordering

The DWARF standard requires that the DIEs in a subprogram
corresponding to input and output parameters appear in declaration
order; this patch adds some new code in dwarfgen to enforce this
ordering (relying on the existing fn.Dcl ordering is not sufficient).

Prior to the register ABI, it was easy to keep vars/decls sorted
during DWARF generation since you could always rely on frame offset;
with the ABI sorting by frame offset no longer gives you the original
declaration order in all cases.

Fixes #46055.

Change-Id: I0e070cb781d6453caba896e5d3bee7cd5388050d
Reviewed-on: https://go-review.googlesource.com/c/go/+/318829
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alessandro Arzilli <alessandro.arzilli@gmail.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/dwarfgen/dwarf.go
src/cmd/link/internal/ld/dwarf_test.go