[PATCH] D131309: [ELF] Add ability to get a symbol by name from the hash table section

Joseph Huber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 12:44:37 PDT 2022


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

In D131309#3733081 <https://reviews.llvm.org/D131309#3733081>, @MaskRay wrote:

> I added " (I have a SHT_GNU_HASH state summary for many ELF based OSes https://groups.google.com/g/generic-abi/c/9L03yrxXPBc/m/WKuUjZshAQAJ)" perhaps after you were composing the reply.
>
> SHT_GNU_HASH is quite universal now. At least all OS with serious LLVM support (except Solaris) support it, with some OSes for a long time (almost 10 years; and glibc for 16 years).
> SHT_HASH will probably just benefit Solaris and illumnos (I am not sure how the whole GPU stack works there.)

I see, thanks for the information. It seems we have a `GnuHash` struct to represent the values in LLVM. Do we have the GNU hash function somewhere in the LLVM source? I don't see it used anywhere.

As for this patch, I'd say since this patch is pretty much done and it meets our (LLVM offloading's) immediate needs we may as well support it. Then I can make a follow-up patch that adds the GNU hash support. Since it'll use most of the same logic it should be relatively easy to add-on to this patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131309



More information about the llvm-commits mailing list