From: Petr Machata Date: Wed, 8 Apr 2009 13:33:52 +0000 (+0200) Subject: dwarflint: Handle zero-length address ranges X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4fc245d8737d058a08ca5b88394c6445c0a23098;p=thirdparty%2Felfutils.git dwarflint: Handle zero-length address ranges --- diff --git a/src/dwarflint.c b/src/dwarflint.c index 20189b0f8..6b18e5718 100644 --- a/src/dwarflint.c +++ b/src/dwarflint.c @@ -2317,11 +2317,12 @@ coverage_map_add (struct coverage_map *coverage_map, wr_error (where, ": couldn't find a section that the range %#" PRIx64 "..%#" PRIx64 " covers.\n", address, end); - else + else if (length > 0) { bool range_hole (uint64_t h_start, uint64_t h_length, void *user __attribute__ ((unused))) { + assert (h_length != 0); wr_error (where, ": portion %#" PRIx64 "..%#" PRIx64 ", of the range %#" PRIx64 "..%#" PRIx64 @@ -3903,8 +3904,13 @@ check_aranges_structural (struct section_data *data, struct cu *cu_chain) if (address == 0 && length == 0 && !address_relocated) break; - /* Skip coverage analysis if we have errors. */ - if (retval) + if (length == 0) + /* DWARF 3 spec, 6.1.2 Lookup by Address: Each descriptor + is a pair consisting of the beginning address [...], + followed by the _non-zero_ length of that range. */ + wr_error (&where, ": zero-length address range.\n"); + else if (retval) + /* Skip coverage analysis if we have errors. */ coverage_map_add (coverage_map, address, length, &where, mc_aranges); }