[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
Fri Sep 2 11:39:33 PDT 2022


jhuber6 added a comment.

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

> 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.

Okay, I'll change this patch to implement an API in `libomptarget` for getting symbols either via `GNU_HASH`, `DT_HASH`, or by a linear search of symbols in that order. I already wrote this patch and D132743 <https://reviews.llvm.org/D132743> with all the testing necessary so I can at least be confident that the implementation works without a runtime test.

Side note, I am curious if there is ever a plan for `LLVM` to have `dlsym` features given that we already have the `llvm-libc` project.


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