[PATCH] D73269: [llvm-readobj] - Add a few warnings for --gnu-hash-table.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 23 21:11:04 PST 2020


MaskRay added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/gnuhash.test:205
+
+## Check what we do when the dynamic symbol table is empty. A valid dynamic
+## symbol table can never be empty because should at least contain the zero symbol.
----------------
> what we do

we emit a warning when the dynamic symbol table is empty. A valid dynamic symbol table should have at least one symbol: the symbol with index 0.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:2525
+    // vector. We should not report a warning in this case.
+    bool IsEmptyHashTable =
+        GnuHashTable->symndx == NumSyms && BloomFilter.size() == 1 &&
----------------
`GnuHashTable->symndx == 1` is probably sufficient.

The other conditions are redundant.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73269/new/

https://reviews.llvm.org/D73269





More information about the llvm-commits mailing list