This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Fix DW_FORM_strp


Hi!

There was a bug in my previous patch. DW_FORM_strp has offset_size, not
pointer_size, but as current readelf doesn't support offset_size other than
4 (ie. 4GB+ DWARF-2), I use 4 and added a comment.
BTW: DW_FORM_ref_addr size differs between Dwarf-2 and Dwarf-3, so maybe we
should handle that too.

2001-11-07  Jakub Jelinek  <jakub@redhat.com>

	* readelf.c (read_and_display_addr): DW_FORM_strp is offset_size
	big, not pointer_size.

--- binutils/readelf.c.jj	Tue Nov  6 13:32:02 2001
+++ binutils/readelf.c	Wed Nov  7 13:23:49 2001
@@ -6915,11 +6915,15 @@ read_and_display_attr (attribute, form, 
 
     case DW_FORM_ref_addr:
     case DW_FORM_addr:
-    case DW_FORM_strp:
       uvalue = byte_get (data, pointer_size);
       data += pointer_size;
       break;
 
+    case DW_FORM_strp:
+      uvalue = byte_get (data, /* offset_size */ 4);
+      data += /* offset_size */ 4;
+      break;
+
     case DW_FORM_ref1:
     case DW_FORM_flag:
     case DW_FORM_data1:

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]