This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[patch] Fix readelf so it doesn't complain about corrupt attribute
- From: Cary Coutant <ccoutant at google dot com>
- To: Binutils <binutils at sourceware dot org>
- Date: Tue, 11 Feb 2014 11:35:06 -0800
- Subject: [patch] Fix readelf so it doesn't complain about corrupt attribute
- Authentication-results: sourceware.org; auth=none
When a DW_FORM_flag_present attribute comes at the very end of a debug
section, readelf complains about a corrupt attribute because it's
checking to make sure there's at least one byte of data remaining.
This patch suppresses the check when the form is DW_FORM_flag_present.
Committed as trivial and obvious.
-cary
2014-02-11 Cary Coutant <ccoutant@google.com>
* binutils/dwarf.c (read_and_display_attr_value): Don't warn
for zero-length attribute value.
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 1a62d9f..387504f 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -1468,7 +1468,7 @@ read_and_display_attr_value (unsigned long attribute,
unsigned char * orig_data = data;
unsigned int bytes_read;
- if (data == end)
+ if (data == end && form != DW_FORM_flag_present)
{
warn (_("corrupt attribute\n"));
return data;