aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/gc/main.go
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2020-05-20 13:51:59 -0400
committerThan McIntosh <thanm@google.com>2020-05-26 17:31:19 +0000
commit96ec09da4885f0c09f0b1bb94d0a1e2b483495ca (patch)
treea092d99a91c755ea0c22b440b035d4bbfe3d1c49 /src/cmd/compile/internal/gc/main.go
parentde1f07d56d3a0c8a6ca5cf2553abcf536785e1eb (diff)
downloadgo-96ec09da4885f0c09f0b1bb94d0a1e2b483495ca.tar.gz
go-96ec09da4885f0c09f0b1bb94d0a1e2b483495ca.zip
[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>
Diffstat (limited to 'src/cmd/compile/internal/gc/main.go')
-rw-r--r--src/cmd/compile/internal/gc/main.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go
index b258952457..6e204f49bc 100644
--- a/src/cmd/compile/internal/gc/main.go
+++ b/src/cmd/compile/internal/gc/main.go
@@ -1488,7 +1488,7 @@ func recordFlags(flags ...string) {
return
}
s := Ctxt.Lookup(dwarf.CUInfoPrefix + "producer." + myimportpath)
- s.Type = objabi.SDWARFINFO
+ s.Type = objabi.SDWARFCUINFO
// Sometimes (for example when building tests) we can link
// together two package main archives. So allow dups.
s.Set(obj.AttrDuplicateOK, true)
@@ -1500,7 +1500,7 @@ func recordFlags(flags ...string) {
// compiled, so that the linker can save it in the compile unit's DIE.
func recordPackageName() {
s := Ctxt.Lookup(dwarf.CUInfoPrefix + "packagename." + myimportpath)
- s.Type = objabi.SDWARFINFO
+ s.Type = objabi.SDWARFCUINFO
// Sometimes (for example when building tests) we can link
// together two package main archives. So allow dups.
s.Set(obj.AttrDuplicateOK, true)