Check unit->addr_size to read in the proper number of prologue bytes.
authorNick Clifton <nickc@redhat.com>
Tue, 25 Jun 2002 19:10:00 +0000 (19:10 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 25 Jun 2002 19:10:00 +0000 (19:10 +0000)
bfd/ChangeLog
bfd/dwarf2.c

index a819c81c49267b44ba522063c10e8c8f2e2aa393..71c6cf956ecc591878625999cdbfde938d070c03 100644 (file)
@@ -1,9 +1,15 @@
+2002-06-25  Jason Eckhardt  <jle@rice.edu>
+
+       * dwarf2.c (decode_line_info): Check unit->addr_size
+       to read in the proper number of prologue bytes.
+
 2002-06-25  Nick Clifton  <nickc@cambridge.redhat.com>
 
        * 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.
+       been enabled.   
+
        * targets.c (_bfd_target_vector[]): Only include
        aix5coff64_vec if 64-bit bfd support has been enabled.
 
index e3b8e27370cc90e51b5daca98daa6964de873d6d..008582e1ed5df7808225b79b6e02bd51f95ef68a 100644 (file)
@@ -981,9 +981,20 @@ decode_line_info (unit, stash)
   line_ptr = stash->dwarf_line_buffer + unit->line_offset;
 
   /* Read in the prologue.  */
-  lh.total_length = read_4_bytes (abfd, line_ptr);
-  line_ptr += 4;
-  offset_size = 4;
+  if (unit->addr_size == 4)
+    {
+      lh.total_length = read_4_bytes (abfd, line_ptr);
+      line_ptr += 4;
+      offset_size = 4;
+    }
+  else
+    {
+      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)
     {
       lh.total_length = read_8_bytes (abfd, line_ptr);