diff options
author | Jim Wilson <jimw@sifive.com> | 2018-01-09 16:40:06 -0800 |
---|---|---|
committer | Jim Wilson <jimw@sifive.com> | 2018-01-09 16:40:06 -0800 |
commit | 35fd2b2bcf370837a03f077acf1222f0a7e9c4d1 (patch) | |
tree | 4c6fc1540f4073b297ddcb097539fce0f9f01a47 /opcodes/riscv-dis.c | |
parent | d9ccd460fdbe0e0f3dd9263175aa4b23b207a51e (diff) | |
download | gdb-35fd2b2bcf370837a03f077acf1222f0a7e9c4d1.zip gdb-35fd2b2bcf370837a03f077acf1222f0a7e9c4d1.tar.gz gdb-35fd2b2bcf370837a03f077acf1222f0a7e9c4d1.tar.bz2 |
RISC-V: Disassemble x0 based addresses as 0.
gas/
* testsuite/gas/riscv/auipc-x0.d: New.
* testsuite/gas/riscv/auipc-x0.s: New.
opcodes/
* riscv-dis.c (maybe_print_address): If base_reg is zero,
then the hi_addr value is zero.
Diffstat (limited to 'opcodes/riscv-dis.c')
-rw-r--r-- | opcodes/riscv-dis.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c index cc427b4..cc642d4 100644 --- a/opcodes/riscv-dis.c +++ b/opcodes/riscv-dis.c @@ -101,7 +101,7 @@ maybe_print_address (struct riscv_private_data *pd, int base_reg, int offset) { if (pd->hi_addr[base_reg] != (bfd_vma)-1) { - pd->print_addr = pd->hi_addr[base_reg] + offset; + pd->print_addr = (base_reg != 0 ? pd->hi_addr[base_reg] : 0) + offset; pd->hi_addr[base_reg] = -1; } else if (base_reg == X_GP && pd->gp != (bfd_vma)-1) |