[Openmp-commits] [PATCH] D131309: [Libomptarget] Add utility functions for loading an ELF symbol by name

Jon Chesterfield via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Sep 7 05:03:40 PDT 2022


JonChesterfield accepted this revision.
JonChesterfield added inline comments.
This revision is now accepted and ready to land.


================
Comment at: openmp/libomptarget/plugins/amdgpu/src/rtl.cpp:1613
 
-int getSymbolInfoWithoutLoading(Elf *Elf, char *Base, const char *Symname,
-                                SymbolInfo *Res) {
-  if (elf_kind(Elf) != ELF_K_ELF) {
-    return 1;
-  }
-
-  Elf64_Shdr *SectionHash = findOnlyShtHash(Elf);
-  if (!SectionHash) {
-    return 1;
-  }
-
-  const Elf64_Sym *Sym = elfLookup(Elf, Base, SectionHash, Symname);
-  if (!Sym) {
+int getSymbolInfoWithoutLoading(const ELFObjectFile<ELF64LE> &ELFObj,
+                                StringRef SymName, SymbolInfo *Res) {
----------------
Possible follow up is to have this return an Expected<SymbolInfo> but that's not worth doing inline with 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 Openmp-commits mailing list