<div dir="ltr">Thanks Charlie for working on this.  Already passed regressions and committed.<div><br></div><div>Nelson</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Jan 8, 2025 at 5:35 AM Charlie Jenkins <<a href="mailto:charlie@rivosinc.com">charlie@rivosinc.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">When testing linux perf, I noticed that this behavior of objdump has<br>
changed. Before this patch and running `perf test` on riscv the<br>
following test fails due to objdump not returning all of the expected<br>
bytes.<br>
<br>
Bytes read differ from those read by objdump<br>
buf1 (dso):<br>
0x97 0xf7 0x11 0x00 0x93 0x87 0xc7 0x7c 0x22 0x85 0x7c 0xec 0xef 0x50 0x80 0x12<br>
0xa6 0x85 0xce 0x86 0x4a 0x86 0x22 0x85 0xef 0x50 0x40 0x40 0xa2 0x84 0x1d 0xc9<br>
0x7c 0x58 0x85 0x8b 0x85 0xc3 0x1c 0x40 0xa1 0x8b 0x89 0xcf 0x83 0x27 0x04 0x0c<br>
0x63 0x51 0xf0 0x04 0x97 0xf7 0x11 0x00 0x93 0x87 0x07 0x45 0xbe 0x86 0x58 0x70<br>
0x74 0xec 0x7c 0xf3 0xa2 0x70 0x02 0x74 0x42 0x69 0xa2 0x69 0x26 0x85 0xe2 0x64<br>
0x45 0x61 0x82 0x80 0x22 0x85 0xef 0x50 0x50 0x52 0x22 0x85 0xef 0x00 0xb1 0x39<br>
0xa2 0x70 0x02 0x74 0x81 0x44 0x42 0x69 0xa2 0x69 0x26 0x85 0xe2 0x64 0x45 0x61<br>
0x82 0x80 0x97 0x06 0x12 0x00 0x93 0x86 0xa6 0x8a 0x97 0xf7 0x11 0x00 0x93 0x87<br>
<br>
buf2 (objdump):<br>
0x97 0xf7 0x11 0x00 0x93 0x87 0xc7 0x7c 0x22 0x85 0x7c 0xec 0xef 0x50 0x80 0x12<br>
0xa6 0x85 0xce 0x86 0x4a 0x86 0x22 0x85 0xef 0x50 0x40 0x40 0xa2 0x84 0x1d 0xc9<br>
0x7c 0x58 0x85 0x8b 0x85 0xc3 0x1c 0x40 0xa1 0x8b 0x89 0xcf 0x83 0x27 0x04 0x0c<br>
0x63 0x51 0xf0 0x04 0x97 0xf7 0x11 0x00 0x93 0x87 0x07 0x45 0xbe 0x86 0x58 0x70<br>
0x74 0xec 0x7c 0xf3 0xa2 0x70 0x02 0x74 0x42 0x69 0xa2 0x69 0x26 0x85 0xe2 0x64<br>
0x45 0x61 0x82 0x80 0x22 0x85 0xef 0x50 0x50 0x52 0x22 0x85 0xef 0x00 0xb1 0x39<br>
0xa2 0x70 0x02 0x74 0x81 0x44 0x42 0x69 0xa2 0x69 0x26 0x85 0xe2 0x64 0x45 0x61<br>
0x82 0x80 0x97 0x06 0x12 0x00 0x93 0x86 0xa6 0x8a 0x97 0xf7 0x11 0x00 0xad 0x00<br>
<br>
---- end(-1) ----<br>
 24: Object code reading                              : FAILED!<br>
<br>
After this patch, this test case no longer fails, as objdump returns the<br>
expected values.<br>
<br>
Signed-off-by: Charlie Jenkins <<a href="mailto:charlie@rivosinc.com" target="_blank">charlie@rivosinc.com</a>><br>
<br>
---<br>
Changes in v4:<br>
- Added test cases<br>
- Changed wording of "disassembly" to "display" (Jan)<br>
- Link to v3: <a href="https://lore.kernel.org/r/20241219-fix_objdump_partial_insn-v3-1-d5ed9af878d1@rivosinc.com" rel="noreferrer" target="_blank">https://lore.kernel.org/r/20241219-fix_objdump_partial_insn-v3-1-d5ed9af878d1@rivosinc.com</a><br>
<br>
Changes in v3:<br>
- More formatting issues (Nelson)<br>
- Link to v2: <a href="https://lore.kernel.org/r/20241216-fix_objdump_partial_insn-v2-1-8de88a115dbc@rivosinc.com" rel="noreferrer" target="_blank">https://lore.kernel.org/r/20241216-fix_objdump_partial_insn-v2-1-8de88a115dbc@rivosinc.com</a><br>
<br>
Changes in v2:<br>
- Fix comment spacing (Jiawei)<br>
- Link to v1: <a href="https://lore.kernel.org/r/20241213-fix_objdump_partial_insn-v1-1-7a4963e655d5@rivosinc.com" rel="noreferrer" target="_blank">https://lore.kernel.org/r/20241213-fix_objdump_partial_insn-v1-1-7a4963e655d5@rivosinc.com</a><br>
<br>
---<br>
Charlie Jenkins (2):<br>
      RISC-V: Fix display of partial instructions<br>
      RISC-V: Add partial instruction display tests<br>
<br>
 gas/testsuite/gas/riscv/dis-partial-insn-byte.d  | 11 +++++<br>
 gas/testsuite/gas/riscv/dis-partial-insn-short.d | 11 +++++<br>
 gas/testsuite/gas/riscv/dis-partial-insn-word.d  | 11 +++++<br>
 gas/testsuite/gas/riscv/dis-partial-insn.s       |  2 +<br>
 opcodes/riscv-dis.c                              | 53 ++++++++++++++++++++++--<br>
 5 files changed, 84 insertions(+), 4 deletions(-)<br>
---<br>
base-commit: 978324718990b6b371d4eeeba02cfe13a0ebf120<br>
change-id: 20241121-fix_objdump_partial_insn-94e236f3db38<br>
-- <br>
- Charlie<br>
<br>
</blockquote></div>