[PATCH] D86923: [llvm-readobj/elf] - Don't crash when the size of a dynamic symbol table, inferred from the hash table, is broken.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 10 03:49:46 PDT 2020


grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/dyn-symbols-size-from-hash-table.test:339
+
+# BROKEN-NCHAIN-LLVM:      warning: '[[FILE]]': the derived from the hash table size (0x17ffffffe8) of the dynamic symbol table at 0xf0 goes past the end of the file (0x348) and will be ignored
+# BROKEN-NCHAIN-LLVM:      Dynamic Relocations {
----------------
jhenderson wrote:
> Here and below, I'd prefer it if we can avoid hard coding the values into the CHECKs, because if the yaml2obj layout changes at all, these values will have to be updated.
> 
> Can you use FileCheck numeric variables to capture the sizes according to the section headers and the file size somewhere, and then use those?
Done.


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:2265
+      reportUniqueWarning(createError(
+          "the derived from the hash table size (0x" +
+          Twine::utohexstr(DerivedSize) +
----------------
MaskRay wrote:
> Do you mean "the hash table size (0x...) derived from ..." ?
Nope. This message is about the size of the dynamic symbol table. This size was derived from the hash table
and the value is too large to be used as a size of the dynamic symbol table.


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

https://reviews.llvm.org/D86923



More information about the llvm-commits mailing list