If pointer_size has not been found then assume that it is 4 in order to
authorNick Clifton <nickc@redhat.com>
Thu, 12 May 2005 09:05:36 +0000 (09:05 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 12 May 2005 09:05:36 +0000 (09:05 +0000)
prevent a seg fault when process_extend_line_op attempts to read the line
data.

binutils/ChangeLog
binutils/readelf.c

index ac2913aa7221e0cab853d1b5fb4c2c1f026c48c1..00ffe8ba1727954cc2fa7e6125c8ea1a00bf5b05 100644 (file)
@@ -1,3 +1,9 @@
+2005-05-12  Nick Clifton  <nickc@redhat.com>
+
+       * readelf.c (display_debug_lines): If pointer_size has not been
+       found then assume that it is 4 in order to prevent a seg fault
+       when process_extend_line_op attempts to read the line data.
+
 2005-05-11  Alan Modra  <amodra@bigpond.net.au>
 
        * readelf.c (get_ppc_dynamic_type): New function for DT_PPC_GLINK.
index 9b83f08229cbed15a73b5abe2c2782ddee5c91a1..c538dd84271d32482e63abf9179215937dd141d8 100644 (file)
@@ -7166,8 +7166,8 @@ reset_state_machine (int is_stmt)
   state_machine_regs.last_file_entry = 0;
 }
 
-/* Handled an extend line op.  Returns true if this is the end
-   of sequence.  */
+/* Handled an extend line op.
+   Returns the number of bytes read.  */
 
 static int
 process_extended_line_op (unsigned char *data, int is_stmt, int pointer_size)
@@ -9097,7 +9097,9 @@ display_debug_lines (Elf_Internal_Shdr *section,
       printf (_("  Line Base:                   %d\n"), info.li_line_base);
       printf (_("  Line Range:                  %d\n"), info.li_line_range);
       printf (_("  Opcode Base:                 %d\n"), info.li_opcode_base);
-      printf (_("  (Pointer size:               %u)\n"), pointer_size);
+      printf (_("  (Pointer size:               %u)%s\n"),
+             pointer_size,
+             warned_about_missing_comp_units ? " [assumed]" : "" );
 
       end_of_sequence = data + info.li_length + initial_length_size;
 
@@ -9188,8 +9190,14 @@ display_debug_lines (Elf_Internal_Shdr *section,
          else switch (op_code)
            {
            case DW_LNS_extended_op:
+             if (pointer_size == 0)
+               {
+                 warn (_("Extend line ops need a valid pointer size, guessing at 4"));
+                 pointer_size = 4;
+               }
+
              data += process_extended_line_op (data, info.li_default_is_stmt,
-                                               pointer_size);
+                                                 pointer_size);
              break;
 
            case DW_LNS_copy:
This page took 0.031366 seconds and 4 git commands to generate.