[ORC] Allow EPCEHFrameRegistrar clients to specify registration function dylib.
authorLang Hames <lhames@gmail.com>
Mon, 24 Oct 2022 20:46:10 +0000 (13:46 -0700)
committerLang Hames <lhames@gmail.com>
Mon, 24 Oct 2022 20:57:04 +0000 (13:57 -0700)
commitc977251ef6fee3f7045039832331e8aab1e0a1b2
treeb05f61c5a699cb09c73c5233649b1c8c09f08469
parent6613f4aff85b24a13d4f5f7e9cd24bf3f44037a3
[ORC] Allow EPCEHFrameRegistrar clients to specify registration function dylib.

Previously, EPCEHFrameRegistrar always used the
ExecutorProcessControl::loadDylib(nullptr) method to obtain a handle for the
process, but this doesn't work if the registration functions aren't visible in
a standard search of the process (e.g. if the JIT is in a plugin that is loaded
with RTLD_LOCAL).

This patch retains the old behavior by default, but allows clients to supply
their own handle for the library containing the registration functions if they
need to (e.g. to work around limitations like RDLD_LOCAL above, which aren't
expressible within the existing loadDylib / DynamicLibrary APIs).
llvm/include/llvm/ExecutionEngine/Orc/EPCEHFrameRegistrar.h
llvm/lib/ExecutionEngine/Orc/EPCEHFrameRegistrar.cpp