]> git.ipfire.org Git - thirdparty/elfutils.git/commit
readelf: Don't print average number of tests when no tests are done
authorMark Wielaard <mark@klomp.org>
Wed, 15 Nov 2023 16:33:42 +0000 (17:33 +0100)
committerMark Wielaard <mark@klomp.org>
Mon, 20 Nov 2023 17:28:46 +0000 (18:28 +0100)
commit374bf6ab3b79637d02183e10899d40243349e4d1
tree2af5878b2592a8505ff4d4b9ff8016819a52cc39
parent2ac936d8ca538ea4e21fd76e9088aa8a89bdbc31
readelf: Don't print average number of tests when no tests are done

If the symbol hash table only contains lenght zero chains, no lookup
tests need to be done and eu-readelf -I would print out bogus numbers
for the number of tests that were successful/unsuccessful.

e.g. for an "empty" program like
  int main() {}
eu-readelf -I would print:

Histogram for bucket list length in section [ 5] '.gnu.hash' (total of 1 bucket):
 Addr: 0x00000000004003c0  Offset: 0x0003c0  Link to section: [ 6] '.dynsym'
 Symbol Bias: 1
 Bitmask Size: 8 bytes  0% bits set  2nd hash shift: 0
 Length  Number  % of total  Coverage
      0       1      100.0%
 Average number of tests:   successful lookup: -nan
  unsuccessful lookup: 0.000000

Only print out the Average number of tests when there were actual
tests to do.

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/readelf.c