From: Petr Machata Date: Tue, 19 Apr 2011 15:30:57 +0000 (+0200) Subject: dwarflint: Fix excessive alignment computation X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8436fa354bc1692668d271f5529d9dd313cc5be5;p=thirdparty%2Felfutils.git dwarflint: Fix excessive alignment computation --- diff --git a/dwarflint/check_debug_loc_range.cc b/dwarflint/check_debug_loc_range.cc index 5d680815e..c2da6206b 100644 --- a/dwarflint/check_debug_loc_range.cc +++ b/dwarflint/check_debug_loc_range.cc @@ -1014,13 +1014,12 @@ found_hole (uint64_t start, uint64_t length, void *data) { /* Zero padding is valid, if it aligns on the bounds of info->align bytes, and is not excessive. */ - if (!(info->align != 0 && info->align != 1 - && (end % info->align == 0) && (start % 4 != 0) - && (length < info->align))) - { - struct where wh = WHERE (info->section, NULL); - wr_message_padding_0 (info->category, &wh, start, end); - } + if (info->align == 0 || info->align == 1 + || length > info->align // excessive + || end % info->align != 0 // doesn't actually align + || start % info->align == 0)// was already aligned + wr_message_padding_0 (info->category, section_locus (info->section), + start, end); } else /* XXX: This actually lies when the unreferenced portion is