]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/{compile,link}: split SDWARFINFO symtype into sub-types
authorThan McIntosh <thanm@google.com>
Wed, 20 May 2020 17:51:59 +0000 (13:51 -0400)
committerThan McIntosh <thanm@google.com>
Tue, 26 May 2020 17:31:19 +0000 (17:31 +0000)
commit96ec09da4885f0c09f0b1bb94d0a1e2b483495ca
treea092d99a91c755ea0c22b440b035d4bbfe3d1c49
parentde1f07d56d3a0c8a6ca5cf2553abcf536785e1eb
[dev.link] cmd/{compile,link}: split SDWARFINFO symtype into sub-types

This change splits the SDWARFINFO symbol type (a generic container of
DWARF content) into separate sub-classes. The new symbol types are

 SDWARFCUINFO    comp unit DIE, also CU info and CU packagename syms
 SDWARFCONST     constant DIE
 SDWARFFCN       subprogram DIE (default and concrete)
 SDWARFABSFCN    abstract function DIE
 SDWARFTYPE      type DIE
 SDWARFVAR       global variable DIE

Advantage of doing this: in the linker there are several places where
we have to iterate over a symbol's relocations to pick out references
to specific classes of DWARF sub-symbols (for example, looking for all
abstract function DIEs referenced by a subprogram DIE, or looking at
all the type DIEs used in a subprogram DIE). By splitting SDWARFINFO
into parts clients can now look only at the relocation target's sym
type as opposed to having to materialize the target sym name, or do a
lookup.

Change-Id: I4e0ee3216d3c8f1a78bec3d296c01e95b3d025b5
Reviewed-on: https://go-review.googlesource.com/c/go/+/234684
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
src/cmd/compile/internal/gc/main.go
src/cmd/internal/obj/objfile.go
src/cmd/internal/obj/objfile2.go
src/cmd/internal/objabi/symkind.go
src/cmd/internal/objabi/symkind_string.go
src/cmd/link/internal/ld/dwarf.go
src/cmd/link/internal/loader/loader.go
src/cmd/link/internal/sym/symkind.go
src/cmd/link/internal/sym/symkind_string.go