#include "llvm/ExecutionEngine/Orc/ELFNixPlatform.h"
#include "llvm/BinaryFormat/ELF.h"
#include "llvm/ExecutionEngine/JITLink/ELF_x86_64.h"
#include "llvm/ExecutionEngine/JITLink/aarch64.h"
#include "llvm/ExecutionEngine/JITLink/ppc64.h"
#include "llvm/ExecutionEngine/JITLink/x86_64.h"
#include "llvm/ExecutionEngine/Orc/DebugUtils.h"
#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
#include "llvm/ExecutionEngine/Orc/Shared/ObjectFormats.h"
#include "llvm/Support/BinaryByteStream.h"
#include "llvm/Support/Debug.h"
#include <optional>
#define DEBUG_TYPE …
usingnamespacellvm;
usingnamespacellvm::orc;
usingnamespacellvm::orc::shared;
namespace {
class DSOHandleMaterializationUnit : public MaterializationUnit { … };
}
namespace llvm {
namespace orc {
Expected<std::unique_ptr<ELFNixPlatform>> ELFNixPlatform::Create(
ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
JITDylib &PlatformJD, std::unique_ptr<DefinitionGenerator> OrcRuntime,
std::optional<SymbolAliasMap> RuntimeAliases) { … }
Expected<std::unique_ptr<ELFNixPlatform>>
ELFNixPlatform::Create(ExecutionSession &ES,
ObjectLinkingLayer &ObjLinkingLayer,
JITDylib &PlatformJD, const char *OrcRuntimePath,
std::optional<SymbolAliasMap> RuntimeAliases) { … }
Error ELFNixPlatform::setupJITDylib(JITDylib &JD) { … }
Error ELFNixPlatform::teardownJITDylib(JITDylib &JD) { … }
Error ELFNixPlatform::notifyAdding(ResourceTracker &RT,
const MaterializationUnit &MU) { … }
Error ELFNixPlatform::notifyRemoving(ResourceTracker &RT) { … }
static void addAliases(ExecutionSession &ES, SymbolAliasMap &Aliases,
ArrayRef<std::pair<const char *, const char *>> AL) { … }
Expected<SymbolAliasMap>
ELFNixPlatform::standardPlatformAliases(ExecutionSession &ES,
JITDylib &PlatformJD) { … }
ArrayRef<std::pair<const char *, const char *>>
ELFNixPlatform::requiredCXXAliases() { … }
ArrayRef<std::pair<const char *, const char *>>
ELFNixPlatform::standardRuntimeUtilityAliases() { … }
bool ELFNixPlatform::supportedTarget(const Triple &TT) { … }
ELFNixPlatform::ELFNixPlatform(
ExecutionSession &ES, ObjectLinkingLayer &ObjLinkingLayer,
JITDylib &PlatformJD,
std::unique_ptr<DefinitionGenerator> OrcRuntimeGenerator, Error &Err)
: … { … }
Error ELFNixPlatform::associateRuntimeSupportFunctions(JITDylib &PlatformJD) { … }
void ELFNixPlatform::getInitializersBuildSequencePhase(
SendInitializerSequenceFn SendResult, JITDylib &JD,
std::vector<JITDylibSP> DFSLinkOrder) { … }
void ELFNixPlatform::getInitializersLookupPhase(
SendInitializerSequenceFn SendResult, JITDylib &JD) { … }
void ELFNixPlatform::rt_getInitializers(SendInitializerSequenceFn SendResult,
StringRef JDName) { … }
void ELFNixPlatform::rt_getDeinitializers(
SendDeinitializerSequenceFn SendResult, ExecutorAddr Handle) { … }
void ELFNixPlatform::rt_lookupSymbol(SendSymbolAddressFn SendResult,
ExecutorAddr Handle,
StringRef SymbolName) { … }
Error ELFNixPlatform::bootstrapELFNixRuntime(JITDylib &PlatformJD) { … }
Error ELFNixPlatform::registerInitInfo(
JITDylib &JD, ArrayRef<jitlink::Section *> InitSections) { … }
Error ELFNixPlatform::registerPerObjectSections(
const ELFPerObjectSectionsToRegister &POSR) { … }
Expected<uint64_t> ELFNixPlatform::createPThreadKey() { … }
void ELFNixPlatform::ELFNixPlatformPlugin::modifyPassConfig(
MaterializationResponsibility &MR, jitlink::LinkGraph &LG,
jitlink::PassConfiguration &Config) { … }
ObjectLinkingLayer::Plugin::SyntheticSymbolDependenciesMap
ELFNixPlatform::ELFNixPlatformPlugin::getSyntheticSymbolDependencies(
MaterializationResponsibility &MR) { … }
void ELFNixPlatform::ELFNixPlatformPlugin::addInitializerSupportPasses(
MaterializationResponsibility &MR, jitlink::PassConfiguration &Config) { … }
void ELFNixPlatform::ELFNixPlatformPlugin::addDSOHandleSupportPasses(
MaterializationResponsibility &MR, jitlink::PassConfiguration &Config) { … }
void ELFNixPlatform::ELFNixPlatformPlugin::addEHAndTLVSupportPasses(
MaterializationResponsibility &MR, jitlink::PassConfiguration &Config) { … }
Error ELFNixPlatform::ELFNixPlatformPlugin::preserveInitSections(
jitlink::LinkGraph &G, MaterializationResponsibility &MR) { … }
Error ELFNixPlatform::ELFNixPlatformPlugin::registerInitSections(
jitlink::LinkGraph &G, JITDylib &JD) { … }
Error ELFNixPlatform::ELFNixPlatformPlugin::fixTLVSectionsAndEdges(
jitlink::LinkGraph &G, JITDylib &JD) { … }
}
}