From 8436fa354bc1692668d271f5529d9dd313cc5be5 Mon Sep 17 00:00:00 2001 From: Petr Machata Date: Tue, 19 Apr 2011 17:30:57 +0200 Subject: [PATCH] dwarflint: Fix excessive alignment computation --- dwarflint/check_debug_loc_range.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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 -- 2.47.2