[all-commits] [llvm/llvm-project] c587b0: [llvm-readobj] - Add a validation of the GNU hash ...

Georgii Rymar via All-commits all-commits at lists.llvm.org
Fri Jun 19 04:35:47 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c587b076a0e56d6a70c3bb2b8f9d104a48edbfe4
      https://github.com/llvm/llvm-project/commit/c587b076a0e56d6a70c3bb2b8f9d104a48edbfe4
  Author: Georgii Rymar <grimar at accesssoftek.com>
  Date:   2020-06-19 (Fri, 19 Jun 2020)

  Changed paths:
    M llvm/test/tools/llvm-readobj/ELF/gnuhash.test
    M llvm/test/tools/llvm-readobj/ELF/hash-histogram.test
    M llvm/tools/llvm-readobj/ELFDumper.cpp

  Log Message:
  -----------
  [llvm-readobj] - Add a validation of the GNU hash table to printGnuHashHistogram().

Similar to D81937, we might crash when printing a histogram for a GNU hash table
with a 'symndx' index that is larger than the number of dynamic symbols.

This patch adopts and reuses the `getGnuHashTableChains()` helper which performs
a validation of the table. As a side effect the warning reported for
the --gnu-hash-table was improved.

Also with this change we start to report a warning when the histogram is requested for
the GNU hash table, but the dynamic symbols table is empty (size == 0).

Differential revision: https://reviews.llvm.org/D82010




More information about the All-commits mailing list