aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorJim Wilson <jimw@sifive.com>2018-01-09 16:40:06 -0800
committerJim Wilson <jimw@sifive.com>2018-01-09 16:40:06 -0800
commit35fd2b2bcf370837a03f077acf1222f0a7e9c4d1 (patch)
tree4c6fc1540f4073b297ddcb097539fce0f9f01a47 /opcodes
parentd9ccd460fdbe0e0f3dd9263175aa4b23b207a51e (diff)
downloadbinutils-35fd2b2bcf370837a03f077acf1222f0a7e9c4d1.zip
binutils-35fd2b2bcf370837a03f077acf1222f0a7e9c4d1.tar.gz
binutils-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')
-rw-r--r--opcodes/ChangeLog5
-rw-r--r--opcodes/riscv-dis.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 96bc41c..24d1101 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-09 Jim Wilson <jimw@sifive.com>
+
+ * riscv-dis.c (maybe_print_address): If base_reg is zero,
+ then the hi_addr value is zero.
+
2018-01-09 James Greenhalgh <james.greenhalgh@arm.com>
* arm-dis.c (arm_opcodes): Add csdb.
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)