summaryrefslogtreecommitdiff
path: root/binutils/objdump.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-06-09 14:51:41 +0000
committerJakub Jelinek <jakub@redhat.com>2005-06-09 14:51:41 +0000
commit57557d8344acc7ebbb9eec964431b027cec03d18 (patch)
tree88e6d4a6465db714ce04299389bfd7915f30beab /binutils/objdump.c
parent28967c381e8e78cd32f37a79d1d4e824b54e176d (diff)
downloadbinutils-redhat-57557d8344acc7ebbb9eec964431b027cec03d18.tar.gz
* objdump.c (disassemble_bytes): Don't crash if q->howto == NULL.
If q->howto->name == NULL, print q->howto->type as number instead. (dump_reloc_set): Likewise.
Diffstat (limited to 'binutils/objdump.c')
-rw-r--r--binutils/objdump.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/binutils/objdump.c b/binutils/objdump.c
index cec11def23..e598a23a9e 100644
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -1570,7 +1570,12 @@ disassemble_bytes (struct disassemble_info * info,
objdump_print_value (section->vma - rel_offset + q->address,
info, TRUE);
- printf (": %s\t", q->howto->name);
+ if (q->howto == NULL)
+ printf (": *unknown*\t");
+ else if (q->howto->name)
+ printf (": %s\t", q->howto->name);
+ else
+ printf (": %d\t", q->howto->type);
if (q->sym_ptr_ptr == NULL || *q->sym_ptr_ptr == NULL)
printf ("*unknown*");
@@ -2465,23 +2470,20 @@ dump_reloc_set (bfd *abfd, asection *sec, arelent **relpp, long relcount)
section_name = NULL;
}
+ bfd_printf_vma (abfd, q->address);
+ if (q->howto == NULL)
+ printf (" *unknown* ");
+ else if (q->howto->name)
+ printf (" %-16s ", q->howto->name);
+ else
+ printf (" %-16d ", q->howto->type);
if (sym_name)
- {
- bfd_printf_vma (abfd, q->address);
- if (q->howto->name)
- printf (" %-16s ", q->howto->name);
- else
- printf (" %-16d ", q->howto->type);
- objdump_print_symname (abfd, NULL, *q->sym_ptr_ptr);
- }
+ objdump_print_symname (abfd, NULL, *q->sym_ptr_ptr);
else
{
if (section_name == NULL)
section_name = "*unknown*";
- bfd_printf_vma (abfd, q->address);
- printf (" %-16s [%s]",
- q->howto->name,
- section_name);
+ printf ("[%s]", section_name);
}
if (q->addend)