[dev.link] cmd/compile, cmd/link: move DWARF info sym to anonymous aux data

Switch the primary subprogram die DWARF symbol emitted by the compiler
from named+dupOK to anonymous aux. This should help performance wise
by not having to add these symbols to the linker's symbol name lookup
tables.

Change-Id: Idf66662b8bf60b3dee9a55e6cd5137b24a9f5ab6
Reviewed-on: https://go-review.googlesource.com/c/go/+/223669
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Than McIntosh 2020-03-16 08:13:16 -04:00
parent 62b0790a79
commit 673a02a235
6 changed files with 19 additions and 11 deletions

View file

@ -2140,11 +2140,17 @@ func loadObjSyms(l *Loader, syms *sym.Symbols, r *oReader) int {
osym := goobj2.Sym{}
osym.Read(r.Reader, r.SymOff(i))
name := strings.Replace(osym.Name, "\"\".", r.pkgprefix, -1)
if name == "" {
t := sym.AbiSymKindToSymKind[objabi.SymKind(osym.Type)]
// NB: for the test below, we can skip most anonymous symbols
// since they will never be turned into sym.Symbols (ex:
// funcdata), however DWARF subprogram DIE symbols (which are
// nameless) will eventually need to be turned into
// sym.Symbols (with relocations), so the simplest thing to do
// is include them as part of this loop.
if name == "" && t != sym.SDWARFINFO {
continue
}
ver := abiToVer(osym.ABI, r.version)
t := sym.AbiSymKindToSymKind[objabi.SymKind(osym.Type)]
if t == sym.SXREF {
log.Fatalf("bad sxref")
}