]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/internal/goobj: add index to symbol name for indexed symbols
authorCherry Zhang <cherryyz@google.com>
Tue, 21 Apr 2020 17:07:22 +0000 (13:07 -0400)
committerCherry Zhang <cherryyz@google.com>
Wed, 22 Apr 2020 15:14:44 +0000 (15:14 +0000)
commitc33b7c75928ada72e52945336562afe4a5493bb4
tree2b376687f1ee941df3a79386850094ae1356ebe4
parent245a2f5780ebc956a84964c25804b50f27c2d984
[dev.link] cmd/internal/goobj: add index to symbol name for indexed symbols

With old object files, when objdump an object file which, for
example, contains a call of fmt.Fprintf, it shows a symbol
reference like

R_CALL:fmt.Fprintf

With new object files, as the symbol reference is indexed, the
reference becomes

R_CALL:fmt.#33

The object file does not contain information of what symbol #33
in the fmt package is.

To make this more useful, print the index when dumping the symbol
definitions. This way, when dumping the fmt package, e.g.
"go tool nm fmt.a", it will print

   6c705 T fmt.Fprintf#33

So we can find out what symbol #33 actually is.

Change-Id: I320776597d28615ce18dd0617c352d2b8180db49
Reviewed-on: https://go-review.googlesource.com/c/go/+/229246
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
src/cmd/internal/goobj/goobj_test.go
src/cmd/internal/goobj/readnew.go
src/cmd/nm/nm_test.go
src/cmd/objdump/objdump_test.go