This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Fix DW_FORM_strp
- To: binutils at sources dot redhat dot com
- Subject: [PATCH] Fix DW_FORM_strp
- From: Jakub Jelinek <jakub at redhat dot com>
- Date: Wed, 7 Nov 2001 13:18:16 +0100
- Reply-To: Jakub Jelinek <jakub at redhat dot com>
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