aboutsummaryrefslogtreecommitdiff
path: root/binutils/objdump.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-09-16 15:30:38 +0000
committerIan Lance Taylor <ian@airs.com>1994-09-16 15:30:38 +0000
commit8b129785e413189936bbf180f8a0f09afbc43ddb (patch)
treec9e2e61bb1ec7b38d1dbdb64859fff7c8d41a4f3 /binutils/objdump.c
parente3a58c921b000b5044371585f199956579847a40 (diff)
downloadgdb-8b129785e413189936bbf180f8a0f09afbc43ddb.zip
gdb-8b129785e413189936bbf180f8a0f09afbc43ddb.tar.gz
gdb-8b129785e413189936bbf180f8a0f09afbc43ddb.tar.bz2
* objdump.c (struct objdump_disasm_info): Add field require_sec.
(objdump_print_address): If aux->require_sec, require that the symbol be in aux->sec even if HAS_RELOC is not set. (disassemble_data): Set aux.require_sec around the objdump_print_address call for the instruction address. PR 3441.
Diffstat (limited to 'binutils/objdump.c')
-rw-r--r--binutils/objdump.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c
index e531f20..496033f 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -58,6 +58,7 @@ char *only; /* -j secname */
struct objdump_disasm_info {
bfd *abfd;
asection *sec;
+ boolean require_sec;
};
/* Architecture to disassemble for, or default if NULL. */
@@ -421,7 +422,8 @@ objdump_print_address (vma, info)
long i;
aux = (struct objdump_disasm_info *) info->application_data;
- if ((aux->abfd->flags & HAS_RELOC)
+ if ((aux->require_sec
+ || (aux->abfd->flags & HAS_RELOC) != 0)
&& vma >= bfd_get_section_vma (aux->abfd, aux->sec)
&& vma < (bfd_get_section_vma (aux->abfd, aux->sec)
+ bfd_get_section_size_before_reloc (aux->sec))
@@ -665,7 +667,9 @@ disassemble_data (abfd)
}
}
}
+ aux.require_sec = true;
objdump_print_address (section->vma + i, &disasm_info);
+ aux.require_sec = false;
putchar (' ');
if (disassemble_fn)