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

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 2 01:10:55 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/dyn-symbols-size-from-hash-table.test:330
+##         It is so large that symbol table goes past the end of the file. We have a dynamic
+##         relocation which refers to the symbol with the index that is also too large to be
+##         in the file. Check we report a warning when trying to dump this relocation.
----------------



================
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 {
----------------
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?


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

https://reviews.llvm.org/D86923



More information about the llvm-commits mailing list