Skip to content

Commit 282a14e

Browse files
committed
cmd/internal/objabi,cmd/link/internal/sym: add SDWARFADDR symbol type
Add a new symbol type: SDWARFADDR. This kind of symbol stores content to be added to the DWARF .debug_addr section (new with DWARF5). At the moment these symbols are created only in the linker, but it's not hard to imagine other implementations in which the compiler would create them, so they are added to both the compiler and linker symbol kind space. Updates #26379. Change-Id: I4a82ead0d59fe6028abfd6d6e3fc3df2e28c0ef6 Reviewed-on: https://go-review.googlesource.com/c/go/+/634415 Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Cherry Mui <cherryyz@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
1 parent 31b800a commit 282a14e

File tree

4 files changed

+16
-11
lines changed

4 files changed

+16
-11
lines changed

src/cmd/internal/objabi/symkind.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const (
7070
SDWARFRANGE
7171
SDWARFLOC
7272
SDWARFLINES
73+
SDWARFADDR
7374
// Coverage instrumentation counter for libfuzzer.
7475
SLIBFUZZER_8BIT_COUNTER
7576
// Coverage instrumentation counter, aux variable for cmd/cover

src/cmd/internal/objabi/symkind_string.go

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/link/internal/sym/symkind.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ const (
141141
SDWARFRANGE
142142
SDWARFLOC
143143
SDWARFLINES
144+
SDWARFADDR
144145

145146
// SEH symbol types
146147
SSEHUNWINDINFO
@@ -171,6 +172,7 @@ var AbiSymKindToSymKind = [...]SymKind{
171172
objabi.SDWARFRANGE: SDWARFRANGE,
172173
objabi.SDWARFLOC: SDWARFLOC,
173174
objabi.SDWARFLINES: SDWARFLINES,
175+
objabi.SDWARFADDR: SDWARFADDR,
174176
objabi.SLIBFUZZER_8BIT_COUNTER: SLIBFUZZER_8BIT_COUNTER,
175177
objabi.SCOVERAGE_COUNTER: SCOVERAGE_COUNTER,
176178
objabi.SCOVERAGE_AUXVAR: SCOVERAGE_AUXVAR,
@@ -232,5 +234,5 @@ func (t SymKind) IsNOPTRDATA() bool {
232234
}
233235

234236
func (t SymKind) IsDWARF() bool {
235-
return SDWARFSECT <= t && t <= SDWARFLINES
237+
return SDWARFSECT <= t && t <= SDWARFADDR
236238
}

src/cmd/link/internal/sym/symkind_string.go

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)