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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 18:25:22 PDT 2022


MaskRay added a comment.

In D131309#3760091 <https://reviews.llvm.org/D131309#3760091>, @jhuber6 wrote:

> In D131309#3760085 <https://reviews.llvm.org/D131309#3760085>, @MaskRay wrote:
>
>> Can you elaborate? When adding a public API, it should be useful. If this is `libomptarget` specific (this DT_HASH case pretty much is), keep it there.
>
> I'm asking because you seemed open to this patch earlier if only `GNU_HASH` was supported. Your main concern was that `DT_HASH` being present may lure users into using the wrong format. If the interface were changed users would not be able to use the wrong format. If instead you think that this is not useful **at all ** then that's the end of it and I'll abandon this patch. There are other public API functions with single users so I figured it wasn't an issue, but it's your call.

It's not a wrong format, but it is a not useful format, nearly not in use. So having the functionality as a public API is not useful. I am somewhat concerned of people using this to do dlsym like things, too, but it is minor.
If the amdgpu offloading stuff can implement the functionality without exposing an API in LLVMObject, that'll be great.


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