]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
dwarflint: Fix excessive alignment computation
authorPetr Machata <pmachata@redhat.com>
Tue, 19 Apr 2011 15:30:57 +0000 (17:30 +0200)
committerPetr Machata <pmachata@redhat.com>
Tue, 19 Apr 2011 15:30:57 +0000 (17:30 +0200)
dwarflint/check_debug_loc_range.cc

index 5d680815e73d4d3bff19fe97639f37c188849e22..c2da6206be2d810799a4989dcb971794b8d46a96 100644 (file)
@@ -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