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

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 01:35:49 PDT 2020


grimar added inline comments.


================
Comment at: llvm/test/tools/llvm-readobj/ELF/gnuhash.test:128
 # SYMNDX-NEXT:   Buckets: [2]
-# SYMNDX-NEXT: warning: '[[FILE]]': unable to dump 'Values' for the SHT_GNU_HASH section: the first hashed symbol index (2) is larger than the number of dynamic symbols (2)
+# SYMNDX-NEXT: warning: '[[FILE]]': unable to dump 'Values' for the SHT_GNU_HASH section: the first hashed symbol index (2) is greater than or equal to the number of dynamic symbols (2)
 # SYMNDX-NEXT: }
----------------
jhenderson wrote:
> This test looks like it might need updating?
This message comes from a different place,
for LLVM style we show it when fail to dump `Values`:

```
void ELFDumper<ELFT>::printGnuHashTable() {
.....

  Expected<ArrayRef<Elf_Word>> Chains =
      getGnuHashTableChains<ELFT>(DynSymRegion, GnuHashTable);
  if (!Chains) {
    reportUniqueWarning(
        createError("unable to dump 'Values' for the SHT_GNU_HASH "
                    "section: " +
                    toString(Chains.takeError())));
    return;
  }

  W.printHexList("Values", *Chains);
```

I.e. it is unrelated to this patch, I think I just copypasted this error previously.
And for this particular place it seems that mentioning `'Values'` in the message is reasonable.


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

https://reviews.llvm.org/D88561



More information about the llvm-commits mailing list