From: Petr Machata Date: Tue, 14 Jul 2009 13:35:19 +0000 (+0200) Subject: dwarflint: Introduce `necessary_alignment' X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=635ec00bc0ebffe727af9b97c7edbd424af00dde;p=thirdparty%2Felfutils.git dwarflint: Introduce `necessary_alignment' --- diff --git a/src/dwarflint.c b/src/dwarflint.c index 96c7972df..380876674 100644 --- a/src/dwarflint.c +++ b/src/dwarflint.c @@ -1078,6 +1078,12 @@ address_aligned (uint64_t addr, uint64_t align) return align < 2 || (addr % align == 0); } +static bool +necessary_alignment (uint64_t start, uint64_t length, uint64_t align) +{ + return address_aligned (start + length, align) && length < align; +} + static void process_file (Dwarf *dwarf, const char *fname, bool only_one) { @@ -2198,7 +2204,7 @@ coverage_map_found_hole (uint64_t begin, uint64_t end, if (zeroes) return true; } - else if (address_aligned (base + end, align) && end - begin < align) + else if (necessary_alignment (base + begin, end - begin, align)) return true; char buf[128];