]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile,cmd/asm: fix buglet in -S=2 output
authorThan McIntosh <thanm@google.com>
Thu, 24 Sep 2020 20:11:43 +0000 (16:11 -0400)
committerThan McIntosh <thanm@google.com>
Thu, 24 Sep 2020 21:51:51 +0000 (21:51 +0000)
In CL 255718 the -S=2 assembly output was enhanced to dump symbol
ABIs. This patch fixes a bug in that CL: when dumping the relocations
on a symbol, we were dumping the symbol's ABI as opposed to the
relocation target symbol's ABI.

Change-Id: I134128687757f549fa37b998cff1290765889140
Reviewed-on: https://go-review.googlesource.com/c/go/+/257202
Trust: Than McIntosh <thanm@google.com>
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/cmd/internal/obj/objfile.go

index aede5fe71c70d2e340c6af182be2743d90d39c4b..e4b96205684af8d33c9f6c103b1190ad04c01dab 100644 (file)
@@ -734,7 +734,7 @@ func (ctxt *Link) writeSymDebugNamed(s *LSym, name string) {
                if r.Sym != nil {
                        name = r.Sym.Name
                        if ctxt.Debugasm > 1 {
-                               ver = fmt.Sprintf("<%d>", s.ABI())
+                               ver = fmt.Sprintf("<%d>", r.Sym.ABI())
                        }
                } else if r.Type == objabi.R_TLS_LE {
                        name = "TLS"