[PATCH] D88561: [llvm-readobj] - Fix possible crashes related to dumping gnu hash symbols.

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 03:08:58 PDT 2020


jhenderson added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/hash-symbols.test:723
+
+## In this case one of chain values doesn't end with a stopper bit and llvm-readelf attempts to read
+## a dynamic symbol with index, that is equal to the number of dynamic symbols.
----------------



================
Comment at: llvm/test/tools/llvm-readobj/ELF/hash-symbols.test:724
+## In this case one of chain values doesn't end with a stopper bit and llvm-readelf attempts to read
+## a dynamic symbol with index, that is equal to the number of dynamic symbols.
+
----------------



================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:2748
                        Twine(GnuHashTable->symndx) +
-                       ") is larger than the number of dynamic symbols (" +
+                       ") is larger or equal to the number of dynamic symbols (" +
                        Twine(NumSyms) + ")");
----------------



================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:4061
+          "unable to print hashed symbol with index " + Twine(SymIndex) +
+          ", which is greater or equal to the number of dynamic symbols (" +
+          Twine::utohexstr(SymsTotal) + ")"));
----------------



================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:4073-4074
+    this->reportUniqueWarning(
+        createError("unable to get 'Values' for the SHT_GNU_HASH "
+                    "section: " +
+                    toString(ValuesOrErr.takeError())));
----------------
I'm not sure I understand what `'Values'` here is referring to. Is it the hash values, or something else? Either way, there needs to be more context here.


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

https://reviews.llvm.org/D88561



More information about the llvm-commits mailing list