[PATCH] D80215: [llvm-readelf] - --elf-hash-histogram: do not crash when the .gnu.hash goes past the EOF.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 29 03:13:28 PDT 2020


grimar marked an inline comment as done.
grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/hash-histogram.test:273
+## Case A: the 'nbuckets' field is set so that the GNU hash table goes past the end of the file.
+##         The value of 1 for the NBUCKETS is no-op.
+# RUN: yaml2obj --docnum=6 -D MASKWORDS=4294967295 -D NBUCKETS=1 %s -o %t7
----------------
jhenderson wrote:
> Could you clarify why the no-op values have changed?
`BloomFilter` and `HashBuckets` both have one value (0x0) each:

```
## The number of words in the Bloom filter.
      MaskWords: [[MASKWORDS]]
## The number of hash buckets.
      NBuckets:  [[NBUCKETS]]
    BloomFilter: [ 0x0 ]
    HashBuckets: [ 0x0 ]
```

So previous values (2 and 3) were wrong. I guess I've took these arrays from another test,
simplified them, but forgot to change the no-op values previously...


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

https://reviews.llvm.org/D80215





More information about the llvm-commits mailing list