From: Petr Machata Date: Tue, 14 Jul 2009 13:23:47 +0000 (+0200) Subject: dwarflint: Additional check for DW_AT_low_pc/high_pc/ranges at DIE X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8b2681f12e22341d96f9393fd34b16d0377380d;p=thirdparty%2Felfutils.git dwarflint: Additional check for DW_AT_low_pc/high_pc/ranges at DIE --- diff --git a/src/dwarflint.c b/src/dwarflint.c index 6868bab97..c7d4d9a7d 100644 --- a/src/dwarflint.c +++ b/src/dwarflint.c @@ -1838,7 +1838,9 @@ abbrev_table_load (struct read_ctx *ctx) bool null_attrib; uint64_t sibling_attr = 0; - bool low_pc = false, high_pc = false; + bool low_pc = false; + bool high_pc = false; + bool ranges = false; do { uint64_t attr_off = read_ctx_get_offset (ctx); @@ -1938,6 +1940,8 @@ abbrev_table_load (struct read_ctx *ctx) ": %s with invalid form \"%s\".\n", dwarf_attr_string (attrib_name), dwarf_form_string (attrib_form)); + if (attrib_name == DW_AT_ranges) + ranges = true; } /* Similar for DW_AT_{low,high}_pc, plus also make sure we don't see high_pc without low_pc. */ @@ -1967,6 +1971,9 @@ abbrev_table_load (struct read_ctx *ctx) if (high_pc && !low_pc) wr_error (&where, ": the abbrev has DW_AT_high_pc without also having DW_AT_low_pc.\n"); + else if (high_pc && ranges) + wr_error (&where, + ": the abbrev has DW_AT_high_pc & DW_AT_low_pc, but also has DW_AT_ranges.\n"); } for (section = section_chain; section != NULL; section = section->next)