* objdump.c (disassemble_bytes): Don't crash if q->howto == NULL.
authorJakub Jelinek <jakub@redhat.com>
Thu, 9 Jun 2005 14:51:41 +0000 (14:51 +0000)
committerJakub Jelinek <jakub@redhat.com>
Thu, 9 Jun 2005 14:51:41 +0000 (14:51 +0000)
If q->howto->name == NULL, print q->howto->type as number instead.
(dump_reloc_set): Likewise.

binutils/ChangeLog
binutils/objdump.c

index 23ab45b6c150120aee08203d279378001fe1b439..3117f14e418cb0e21c68d4784a3d0c5a3da3eb0e 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-09  Jakub Jelinek  <jakub@redhat.com>
+
+       * 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.
+
 2005-06-07  Eric Christopher  <echristo@redhat.com>
 
        * readelf.c (guess_is_rela): Support ms1.
index cec11def23c68bc8f406432ab82e6ca3cd2afa12..e598a23a9edbb31faae85a3472d45efaed57ebeb 100644 (file)
@@ -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)