From bdc4de1b24353c4213e404029252ec75065499de Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Mon, 22 Jun 2015 16:53:27 +0100 Subject: 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. --- opcodes/vax-dis.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'opcodes/vax-dis.c') diff --git a/opcodes/vax-dis.c b/opcodes/vax-dis.c index a7a1ccb..da4ba7c 100644 --- a/opcodes/vax-dis.c +++ b/opcodes/vax-dis.c @@ -402,7 +402,8 @@ print_insn_vax (bfd_vma memaddr, disassemble_info *info) argp = NULL; /* Check if the info buffer has more than one byte left since the last opcode might be a single byte with no argument data. */ - if (info->buffer_length - (memaddr - info->buffer_vma) > 1) + if (info->buffer_length - (memaddr - info->buffer_vma) > 1 + && (info->stop_vma == 0 || memaddr < (info->stop_vma - 1))) { FETCH_DATA (info, buffer + 2); } -- cgit v1.1