This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readobj] - Improve test of --elf-hash-histogram option.
ClosedPublic

Authored by grimar on Mar 27 2020, 5:37 AM.

Details

Summary

This test missed the check of histograms printed for .hash sections.
It was removed by mistake in D71606 where I tried to get rid of precompiled objects
and seems did not realize that time that both SHT_GNU_HASH and SHT_HASH sections
were tested and not just GNU version.

Also it never tested aliases for the --elf-hash-histogram option.

Diff Detail

Event Timeline

grimar created this revision.Mar 27 2020, 5:37 AM
jhenderson added inline comments.Mar 30 2020, 1:06 AM
llvm/test/tools/llvm-readobj/ELF/hash-histogram.test
8

Perhaps add a blank line before this comment.

21

You probably need to make this HIST-NEXT and/or add HIST-EMPTY before it to show that there are no more lines after the previous table.

26

Similarly, adding a HIST-EMPTY at the end here would be wise.

57–58

Up to you, but you could avoid this macro by setting the AddressAlign property of the .hash section to some size, e.g. 0x100, and then just use that.

grimar updated this revision to Diff 253558.Mar 30 2020, 5:12 AM
grimar marked 5 inline comments as done.
  • Addressed review comments.
llvm/test/tools/llvm-readobj/ELF/hash-histogram.test
57–58

And alternative is to swap the order of .hash and .gnu.hash: the size of .hash is the same for 32/64 bit cases.
I've done it.

This revision is now accepted and ready to land.Mar 30 2020, 5:25 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2020, 5:55 AM