Page MenuHomePhabricator

[Libomptarget] Remove use of ELF link_address in x86_64 plugin

Authored by jhuber6 on Aug 9 2022, 12:24 PM.



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.

Diff Detail