From 503a609192b5d13905b40969ea82c62a72b576e0 Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Tue, 11 Feb 2014 11:33:49 -0800 Subject: [PATCH] Fix readelf so it doesn't complain about corrupt attribute. 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. 2014-02-11 Cary Coutant * binutils/dwarf.c (read_and_display_attr_value): Don't warn for zero-length attribute value. --- binutils/ChangeLog | 5 +++++ binutils/dwarf.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index d7f5da1c8db..7c258f6c719 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2014-02-11 Cary Coutant + + * binutils/dwarf.c (read_and_display_attr_value): Don't warn + for zero-length attribute value. + 2014-02-10 Alan Modra * po/binutils.pot: Regenerate. diff --git a/binutils/dwarf.c b/binutils/dwarf.c index 1a62d9f9adb..387504fc630 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; -- 2.30.2