[Openmp-commits] [PATCH] D131516: [Libomptarget] Remove use of ELF link_address in x86_64 plugin

Joseph Huber via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Aug 9 12:24:49 PDT 2022


jhuber6 created this revision.
jhuber6 added reviewers: jdoerfert, tianshilei1992, JonChesterfield, ronlieb.
Herald added a subscriber: pengfei.
Herald added a project: All.
jhuber6 requested review of this revision.
Herald added subscribers: openmp-commits, sstefan1.
Herald added a project: OpenMP.

We use the offloading entires array to determine the relative names and
addressed of device-side kernel functions. The x86_64 plugin previously
derived the device-side entry table by first identifying the
`omp_offloading_entries` section offset in the loaded elf. Then we would
use the base offset of the loaded dyanmic library to identify the
entries array within the loaded image. This relied on some more
unconventional methods which prevented us from using the LLVM dynamic
library loader for this plugin. This patch simplifies this by instead
copying the host-side entry and replacing its address with the
device-side address looked up through `dlsym`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131516

Files:
  openmp/libomptarget/plugins/generic-elf-64bit/src/rtl.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131516.451234.patch
Type: text/x-patch
Size: 5376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220809/9bdaf019/attachment.bin>


More information about the Openmp-commits mailing list