13#include "llvm/Config/config.h"
23 #ifdef HAVE_SYS_STAT_H
34#if defined(HAVE_REGISTER_FRAME) && defined(HAVE_DEREGISTER_FRAME) && \
35 !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)
44 static bool Searched =
false;
45 static void (*rf)(
void *) = 0;
57 static bool Searched =
false;
58 static void (*df)(
void *) = 0;
63 "__deregister_frame");
72#if defined(HAVE_UNW_ADD_DYNAMIC_FDE) || defined(__APPLE__)
74static const char *processFDE(
const char *Entry,
bool isDeregister) {
96 const char *
P = (
const char *)
Addr;
99 P = processFDE(
P,
false);
104 const char *
P = (
const char *)
Addr;
107 P = processFDE(
P,
true);
148#if defined(__BIONIC__) && defined(__arm__)
155#define ARM_MATH_IMPORTS(PP) \
189 PP(__aeabi_idivmod) \
193 PP(__aeabi_ldivmod) \
200 PP(__aeabi_uidivmod) \
210#define ARM_MATH_DECL(name) extern "C" void name();
211ARM_MATH_IMPORTS(ARM_MATH_DECL)
215#if defined(__linux__) && defined(__GLIBC__) && \
216 (defined(__i386__) || defined(__x86_64__))
225#if defined(__linux__) && defined(__GLIBC__)
244#if defined(__i386__) || defined(__x86_64__)
246 if (&__morestack &&
Name ==
"__morestack")
252#if defined(__BIONIC__) && defined(__arm__)
253 if (
Name.compare(0, 8,
"__aeabi_") == 0) {
256#define ARM_MATH_CHECK(fn) if (Name == #fn) return (uint64_t)&fn;
257 ARM_MATH_IMPORTS(ARM_MATH_CHECK)
270 const char *NameStr =
Name.c_str();
275 if (NameStr[0] ==
'_')
283 bool AbortOnFailure) {
286 if (!
Addr && AbortOnFailure)
288 "' which could not be resolved!");
293void RTDyldMemoryManager::anchor() {}
294void MCJITMemoryManager::anchor() {}
#define LLVM_ATTRIBUTE_WEAK
static void deregisterEHFramesInProcess(uint8_t *Addr, size_t Size)
Deregister EH frames in the current process.
void registerEHFrames(uint8_t *Addr, uint64_t LoadAddr, size_t Size) override
Register the EH frames with the runtime so that c++ exceptions work.
virtual void * getPointerToNamedFunction(const std::string &Name, bool AbortOnFailure=true)
This method returns the address of the specified function.
virtual uint64_t getSymbolAddress(const std::string &Name)
Legacy symbol lookup - DEPRECATED! Please override findSymbol instead.
static uint64_t getSymbolAddressInProcess(const std::string &Name)
This method returns the address of the specified function or variable in the current process.
static void registerEHFramesInProcess(uint8_t *Addr, size_t Size)
Register EH frames in the current process.
~RTDyldMemoryManager() override
void deregisterEHFrames() override
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
static void * SearchForAddressOfSymbol(const char *symbolName)
This function will search through all previously loaded dynamic libraries for the symbol symbolName.
This is an optimization pass for GlobalISel generic memory operations.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
void __register_frame(void *)
void __deregister_frame(void *)