cmd/internal/obj: print symbol index at -S=3

When the compiler or assembler's -S flag is set to 3 or higher,
print the symbol index, for debugging.

Change-Id: Ia7a42b0c017105ef12fd97b3e52de0e155b0cf2e
Reviewed-on: https://go-review.googlesource.com/c/go/+/585655
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Cherry Mui 2024-05-14 21:39:30 -04:00
parent 408739fc96
commit 8056540772

View file

@ -839,6 +839,9 @@ func (ctxt *Link) writeSymDebugNamed(s *LSym, name string) {
ver := ""
if ctxt.Debugasm > 1 {
ver = fmt.Sprintf("<%d>", s.ABI())
if ctxt.Debugasm > 2 {
ver += fmt.Sprintf("<idx %d %d>", s.PkgIdx, s.SymIdx)
}
}
fmt.Fprintf(ctxt.Bso, "%s%s ", name, ver)
if s.Type != 0 {