summaryrefslogtreecommitdiff
path: root/opcodes/arm-dis.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-01-09 20:29:48 +0000
committerNick Clifton <nickc@redhat.com>2001-01-09 20:29:48 +0000
commit9427c61b1c466b9bfbe539b0e689e14458d2a0e1 (patch)
tree39ccb590b19400dc6b0ea0220e4514b2d0b9225b /opcodes/arm-dis.c
parent15ff1e06a827914d3d36bb2d459decf851057cc5 (diff)
downloadgdb-9427c61b1c466b9bfbe539b0e689e14458d2a0e1.tar.gz
Fix disassembly of arm-elf instructions with relocs associated with them.
Diffstat (limited to 'opcodes/arm-dis.c')
-rw-r--r--opcodes/arm-dis.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/opcodes/arm-dis.c b/opcodes/arm-dis.c
index 262406bd23d..686b18a1a91 100644
--- a/opcodes/arm-dis.c
+++ b/opcodes/arm-dis.c
@@ -1043,6 +1043,14 @@ print_insn (pc, info, little)
given = (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | (b[3]);
}
+ if (info->flags & INSN_HAS_RELOC)
+ /* If the instruction has a reloc associated with it, then
+ the offset field in the instruction will actually be the
+ addend for the reloc. (We are using REL type relocs).
+ In such cases, we can ignore the pc when computing
+ addresses, since the addend is not currently pc-relative. */
+ pc = 0;
+
if (is_thumb)
status = print_insn_thumb (pc, info, given);
else