summaryrefslogtreecommitdiff
path: root/opcodes/mcore-dis.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2015-06-22 16:53:27 +0100
committerNick Clifton <nickc@redhat.com>2015-06-22 16:53:27 +0100
commitbdc4de1b24353c4213e404029252ec75065499de (patch)
treec3ad4f2c6df81c81c6caae1251ecfd91fbcaee3e /opcodes/mcore-dis.c
parent07fcd30112bb071e8dda0a2229a860f2874a7816 (diff)
downloadbinutils-gdb-bdc4de1b24353c4213e404029252ec75065499de.tar.gz
Stop "objdump -d" from disassembling past a symbolic address.
include * dis-asm.h (struct disassemble_info): Add stop_vma field. binuti * objdump.c (disassemble_bytes): Set the stop_vma field in the disassemble_info structure when disassembling code sections with -d. * doc/binutils.texi (objdump): Document the discrepancy between -d and -D. opcodes * dis-buf.c (buffer_read_memory): Fail is stop_vma is set and the requested region lies beyond it. * bfin-dis.c (print_insn_bfin): Ignore sysop instructions when looking for 32-bit insns. * mcore-dis.c (print_insn_mcore): Disable stop_vma when reading data. * sh-dis.c (print_insn_sh): Likewise. * tic6x-dis.c (print_insn_tic6x): Disable stop_vma when reading blocks of instructions. * vax-dis.c (print_insn_vax): Check that the requested address does not clash with the stop_vma. tests * gas/arm/backslash-at.s: Add extra .byte directives so that the foo symbol does not appear to point half way through an instruction. * gas/arm/backslash-at.d: Update expected disassembly. * gas/i386/ilp32/x86-64-opcode-inval-intel.d: Likewise. * gas/i386/ilp32/x86-64-opcode-inval.d: Likewise. * gas/i386/x86-64-opcode-inval-intel.d: Likewise. * gas/i386/x86-64-opcode-inval.d: Likewise.
Diffstat (limited to 'opcodes/mcore-dis.c')
-rw-r--r--opcodes/mcore-dis.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/opcodes/mcore-dis.c b/opcodes/mcore-dis.c
index dc62099e7ae..536f79b4551 100644
--- a/opcodes/mcore-dis.c
+++ b/opcodes/mcore-dis.c
@@ -88,9 +88,8 @@ static const char *crname[] = {
static const unsigned isiz[] = { 2, 0, 1, 0 };
int
-print_insn_mcore (memaddr, info)
- bfd_vma memaddr;
- struct disassemble_info *info;
+print_insn_mcore (bfd_vma memaddr,
+ struct disassemble_info *info)
{
unsigned char ibytes[4];
fprintf_ftype print_func = info->fprintf_func;
@@ -233,6 +232,9 @@ print_insn_mcore (memaddr, info)
val = (memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC;
+ /* We are not reading an instruction, so allow
+ reads to extend beyond the next symbol. */
+ info->stop_vma = 0;
status = info->read_memory_func (val, ibytes, 4, info);
if (status != 0)
{
@@ -263,6 +265,9 @@ print_insn_mcore (memaddr, info)
val = (memaddr + 2 + ((inst & 0xFF) << 2)) & 0xFFFFFFFC;
+ /* We are not reading an instruction, so allow
+ reads to extend beyond the next symbol. */
+ info->stop_vma = 0;
status = info->read_memory_func (val, ibytes, 4, info);
if (status != 0)
{