From: Ulrich Drepper Date: Tue, 29 Jan 2008 10:42:07 +0000 (+0000) Subject: Fix elflint messages for new hash table analysis. X-Git-Tag: elfutils-0.133~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5530ec5bbb95d2041ba9ece15ba10fe2b1d86eab;p=thirdparty%2Felfutils.git Fix elflint messages for new hash table analysis. --- diff --git a/src/ChangeLog b/src/ChangeLog index e7ed847aa..95c28a9f0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2008-01-29 Ulrich Drepper + + * elflint.c (check_gnu_hash): Fix index value printed in error message. + 2008-01-24 Ulrich Drepper * elflint.c (check_group): Check that signature symbol for section diff --git a/src/elflint.c b/src/elflint.c index 100328742..b65170ce4 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -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)))