[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 1 02:35:25 PDT 2020


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

In D88561#2304127 <https://reviews.llvm.org/D88561#2304127>, @uweigand wrote:

> I think the handling of the GNU hash table is actually already fully correct.  The crash (or error message when using this patch) is simply a side effect of the fact that size of the DynSymRegion was clobbered here (near the end of ELFDumper<ELFT>::parseDynamicTable()):
>
>   DynSymRegion->Size = HashTable->nchain * DynSymRegion->EntSize;
>
> This in turn is because HashTable->nchain (like all of HashTable) is just incorrect on s390x at the moment, as discussed in https://bugs.llvm.org/show_bug.cgi?id=47681

That is true for you executable. But this patch fixes a bit different case. Here I am creating the `.gnu.hash` table with a broken value in the buckets array.
Currently with the test case provided we crash an all platforms at the same place where your executable crashes too.
So with this patch we fix the crash, but not the reason of PR47681, which is s390x specific.


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

https://reviews.llvm.org/D88561



More information about the llvm-commits mailing list