[dev.link] cmd/internal/obj: add dump of aux symbols for -S=2

For compiler developers interested in seeing DWARF generation details,
this patch provides symbol "debug asm" dumps for DWARF aux symbols
when -S=2 is in effect.

Change-Id: I5a0b6b65ce7b708948cbbf23c6b0d279bd4f8d9f
Reviewed-on: https://go-review.googlesource.com/c/go/+/223017
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Than McIntosh 2020-03-11 11:18:00 -04:00
parent 8634642f9a
commit c44af2d4a2
3 changed files with 81 additions and 23 deletions

View file

@ -21,7 +21,11 @@ func WriteObjFile(ctxt *Link, bout *bio.Writer, pkgpath string) {
}
func (ctxt *Link) writeSymDebug(s *LSym) {
fmt.Fprintf(ctxt.Bso, "%s ", s.Name)
ctxt.writeSymDebugNamed(s, s.Name)
}
func (ctxt *Link) writeSymDebugNamed(s *LSym, name string) {
fmt.Fprintf(ctxt.Bso, "%s ", name)
if s.Type != 0 {
fmt.Fprintf(ctxt.Bso, "%v ", s.Type)
}