2002-06-27 Kevin Buettner <kevinb@redhat.com>
authorAlan Modra <amodra@gmail.com>
Thu, 27 Jun 2002 11:51:42 +0000 (11:51 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 27 Jun 2002 11:51:42 +0000 (11:51 +0000)
* dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit
DWARF2 formats.

bfd/ChangeLog
bfd/dwarf2.c

index ff06e42..68f0282 100644 (file)
@@ -1,3 +1,8 @@
+2002-06-27  Kevin Buettner <kevinb@redhat.com>
+
+       * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit
+       DWARF2 formats.
+
 2002-06-27  Alan Modra  <amodra@bigpond.net.au>
 
        * cpu-powerpc.c: Comment on ordering of arch_info.
@@ -20,8 +25,8 @@
 
        * config.bfd (powerpc-*-aix5*): Only create a selvecs for
        aix5coff64_vec if 64-bit bfd support has been enabled.
-        (powerpc64-*-aix5*): Only define if 64-bit bfd support has
-       been enabled.   
+       (powerpc64-*-aix5*): Only define if 64-bit bfd support has
+       been enabled.
 
        * targets.c (_bfd_target_vector[]): Only include
        aix5coff64_vec if 64-bit bfd support has been enabled.
index 008582e..005a21f 100644 (file)
@@ -981,24 +981,20 @@ decode_line_info (unit, stash)
   line_ptr = stash->dwarf_line_buffer + unit->line_offset;
 
   /* Read in the prologue.  */
-  if (unit->addr_size == 4)
-    {
-      lh.total_length = read_4_bytes (abfd, line_ptr);
-      line_ptr += 4;
-      offset_size = 4;
-    }
-  else
+  lh.total_length = read_4_bytes (abfd, line_ptr);
+  line_ptr += 4;
+  offset_size = 4;
+  if (lh.total_length == 0xffffffff)
     {
-      BFD_ASSERT (unit->addr_size == 8);
       lh.total_length = read_8_bytes (abfd, line_ptr);
       line_ptr += 8;
       offset_size = 8;
     }
-
-  if (lh.total_length == 0xffffffff)
+  else if (lh.total_length == 0 && unit->addr_size == 8)
     {
-      lh.total_length = read_8_bytes (abfd, line_ptr);
-      line_ptr += 8;
+      /* Handle (non-standard) 64-bit DWARF2 formats.  */
+      lh.total_length = read_4_bytes (abfd, line_ptr);
+      line_ptr += 4;
       offset_size = 8;
     }
   line_end = line_ptr + lh.total_length;