The type symbols were always loaded in LoadFull, as the old
sym.Symbol-based DWARF generation needs them to present. Now we
have converted the DWARF type generation pass, which uses the
loader symbols directly. No need to load the type symbols if they
are not live.
This reduces loaded symbols by ~18% for cmd/compile.
Change-Id: Ic1f6fcdff845f3c62784d05ad716b1742f249481
Reviewed-on: https://go-review.googlesource.com/c/go/+/222018
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
if t == 0 {
log.Fatalf("missing type for %s in %s", name, r.unit.Lib)
}
- if !l.attrReachable.Has(gi) && !(t == sym.SRODATA && strings.HasPrefix(name, "type.")) && name != "runtime.addmoduledata" && name != "runtime.lastmoduledatap" {
+ if !l.attrReachable.Has(gi) && name != "runtime.addmoduledata" && name != "runtime.lastmoduledatap" {
// No need to load unreachable symbols.
- // XXX some type symbol's content may be needed in DWARF code, but they are not marked.
// XXX reference to runtime.addmoduledata may be generated later by the linker in plugin mode.
continue
}