]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix elflint messages for new hash table analysis.
authorUlrich Drepper <drepper@redhat.com>
Tue, 29 Jan 2008 10:42:07 +0000 (10:42 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 29 Jan 2008 10:42:07 +0000 (10:42 +0000)
src/ChangeLog
src/elflint.c

index e7ed847aabdac4060022ae83486df73a848b810a..95c28a9f03eb8794aa1195eaead78fb775e4e18f 100644 (file)
@@ -1,3 +1,7 @@
+2008-01-29  Ulrich Drepper  <drepper@redhat.com>
+
+       * elflint.c (check_gnu_hash): Fix index value printed in error message.
+
 2008-01-24  Ulrich Drepper  <drepper@redhat.com>
 
        * elflint.c (check_group): Check that signature symbol for section
index 1003287424e265a5967ea9df89021c522320e7be..b65170ce4a634bf316694fd888c822bb21194786 100644 (file)
@@ -2062,7 +2062,8 @@ section [%2d] '%s': hash chain for bucket %zu lower than symbol index bias\n"),
                  && GELF_ST_TYPE (sym->st_info) != STT_FUNC)
                ERROR (gettext ("\
 section [%2d] '%s': symbol %u referenced in chain for bucket %zu is undefined\n"),
-                      idx, section_name (ebl, idx), symidx, cnt / 2 - 1);
+                      idx, section_name (ebl, idx), symidx,
+                      cnt - (4 + bitmask_words));
 
              const char *symname = elf_strptr (ebl->elf, symshdr->sh_link,
                                                sym->st_name);
@@ -2072,7 +2073,8 @@ section [%2d] '%s': symbol %u referenced in chain for bucket %zu is undefined\n"
                  if ((hval & ~1u) != (chainhash & ~1u))
                    ERROR (gettext ("\
 section [%2d] '%s': hash value for symbol %u in chain for bucket %zu wrong\n"),
-                          idx, section_name (ebl, idx), symidx, cnt / 2 - 1);
+                          idx, section_name (ebl, idx), symidx,
+                          cnt - (4 + bitmask_words));
 
                  /* Set the bits in the bitmask.  */
                  size_t maskidx = (hval / classbits) & bitmask_idxmask;
@@ -2102,12 +2104,12 @@ section [%2d] '%s': hash value for symbol %u in chain for bucket %zu wrong\n"),
       if (symidx - symbias >= maxidx)
        ERROR (gettext ("\
 section [%2d] '%s': hash chain for bucket %zu out of bounds\n"),
-              idx, section_name (ebl, idx), cnt / 2 - 1);
+              idx, section_name (ebl, idx), cnt - (4 + bitmask_words));
       else if (symshdr != NULL
               && symidx > symshdr->sh_size / symshdr->sh_entsize)
        ERROR (gettext ("\
 section [%2d] '%s': symbol reference in chain for bucket %zu out of bounds\n"),
-              idx, section_name (ebl, idx), cnt / 2 - 1);
+              idx, section_name (ebl, idx), cnt - (4 + bitmask_words));
     }
 
   if (memcmp (collected.p32, bitmask.p32, bitmask_words * sizeof (Elf32_Word)))