bpf: disasemble offsets of value 0 as "+0"
authorDavid Faust <david.faust@oracle.com>
Fri, 21 Jul 2023 18:41:43 +0000 (11:41 -0700)
committerDavid Faust <david.faust@oracle.com>
Fri, 21 Jul 2023 18:49:24 +0000 (11:49 -0700)
commite8fc65713d6e050348d443f9be7b61e6f54c6371
tree7dbac66d0e23fd659ba5c45ab2b948b8e00d4784
parent8a35f6b30a3eac659240f8ea217d351955d3fb3b
bpf: disasemble offsets of value 0 as "+0"

This tiny patch makes the BPF disassembler to emit, e.g.

  ldxdw %r1, [%r0+0]

instead of

  ldxdw %r1, [%r00]

when the offset is 0, to avoid confusion.

opcodes/

* bpf-dis.c (print_insn_bpf): Print offsets with value 0 as "+0".

gas/

* testsuite/gas/bpf/mem.s: Add tests with offset 0.
* testsuite/gas/bpf/mem-pseudoc.s: Likewise.
* testsuite/gas/bpf/mem.d: Update accordingly.
* testsuite/gas/bpf/mem-be.d: Likewise.
* testsuite/gas/bpf/mem-pseudoc.d: Likewise.
* testsuite/gas/bpf/mem-be-pseudoc.d: Likewise.
gas/testsuite/gas/bpf/mem-be-pseudoc.d
gas/testsuite/gas/bpf/mem-be.d
gas/testsuite/gas/bpf/mem-pseudoc.d
gas/testsuite/gas/bpf/mem-pseudoc.s
gas/testsuite/gas/bpf/mem.d
gas/testsuite/gas/bpf/mem.s
opcodes/bpf-dis.c