Commit 0dae2fd1 authored by Keith Randall's avatar Keith Randall

cmd/objdump: fix disassembly suffixes

MOVB $1, (AX) was being disassembled as MOVL $1, (AX).

Use the memory size to override the standard size.
Fix the tests.

Fixes #15922

Change-Id: If92fe74c33a21e5427c8c5cc97dd15e087edb860
Reviewed-on: https://go-review.googlesource.com/23608Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 395f6eba
...@@ -49,7 +49,11 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin ...@@ -49,7 +49,11 @@ func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) strin
op := inst.Op.String() op := inst.Op.String()
if plan9Suffix[inst.Op] { if plan9Suffix[inst.Op] {
switch inst.DataSize { s := inst.DataSize
if inst.MemBytes != 0 {
s = inst.MemBytes * 8
}
switch s {
case 8: case 8:
op += "B" op += "B"
case 16: case 16:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment