14 #include "llvm/Config/config.h" 24 #ifdef HAVE_SYS_STAT_H 36 #if (defined(__GNUC__) && !defined(__ARM_EABI__) && !defined(__ia64__) && \ 37 !defined(__SEH__) && !defined(__USING_SJLJ_EXCEPTIONS__)) 38 #define HAVE_EHTABLE_SUPPORT 1 40 #define HAVE_EHTABLE_SUPPORT 0 43 #if HAVE_EHTABLE_SUPPORT 52 static bool Searched =
false;
53 static void((*rf)(
void *)) = 0;
65 static bool Searched =
false;
66 static void((*df)(
void *)) = 0;
71 "__deregister_frame");
80 static const char *processFDE(
const char *Entry,
bool isDeregister) {
81 const char *
P = Entry;
102 const char *
P = (
const char *)Addr;
103 const char *End = P +
Size;
105 P = processFDE(P,
false);
111 const char *
P = (
const char *)Addr;
112 const char *End = P +
Size;
114 P = processFDE(P,
true);
156 #if defined(__BIONIC__) && defined(__arm__) 163 #define ARM_MATH_IMPORTS(PP) \ 197 PP(__aeabi_idivmod) \ 201 PP(__aeabi_ldivmod) \ 208 PP(__aeabi_uidivmod) \ 218 #define ARM_MATH_DECL(name) extern "C" void name(); 219 ARM_MATH_IMPORTS(ARM_MATH_DECL)
223 #if defined(__linux__) && defined(__GLIBC__) && \ 224 (defined(__i386__) || defined(__x86_64__)) 233 #if defined(__linux__) && defined(__GLIBC__) 243 if (Name ==
"stat")
return (uint64_t)&stat;
244 if (Name ==
"fstat")
return (uint64_t)&fstat;
245 if (Name ==
"lstat")
return (uint64_t)&lstat;
246 if (Name ==
"stat64")
return (uint64_t)&stat64;
247 if (Name ==
"fstat64")
return (uint64_t)&fstat64;
248 if (Name ==
"lstat64")
return (uint64_t)&lstat64;
249 if (Name ==
"atexit")
return (uint64_t)&atexit;
250 if (Name ==
"mknod")
return (uint64_t)&mknod;
252 #if defined(__i386__) || defined(__x86_64__) 254 if (&__morestack && Name ==
"__morestack")
255 return (uint64_t)&__morestack;
257 #endif // __linux__ && __GLIBC__ 260 #if defined(__BIONIC__) && defined(__arm__) 261 if (Name.compare(0, 8,
"__aeabi_") == 0) {
264 #define ARM_MATH_CHECK(fn) if (Name == #fn) return (uint64_t)&fn; 265 ARM_MATH_IMPORTS(ARM_MATH_CHECK)
266 #undef ARM_MATH_CHECK 276 if (Name ==
"__main")
return (uint64_t)&
jit_noop;
278 const char *NameStr = Name.c_str();
283 if (NameStr[0] ==
'_')
291 bool AbortOnFailure) {
294 if (!Addr && AbortOnFailure)
296 "' which could not be resolved!");
301 void RTDyldMemoryManager::anchor() {}
302 void MCJITMemoryManager::anchor() {}
static void * SearchForAddressOfSymbol(const char *symbolName)
This function will search through all previously loaded dynamic libraries for the symbol symbolName...
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
static void registerEHFramesInProcess(uint8_t *Addr, size_t Size)
Register 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 uint64_t getSymbolAddress(const std::string &Name)
Legacy symbol lookup - DEPRECATED! Please override findSymbol instead.
void __register_frame(void *p)
void __deregister_frame(void *p)
amdgpu Simplify well known AMD library false Value Value const Twine & Name
static void deregisterEHFramesInProcess(uint8_t *Addr, size_t Size)
Deregister EH frames in the current proces.
~RTDyldMemoryManager() override
#define LLVM_ATTRIBUTE_WEAK
virtual void * getPointerToNamedFunction(const std::string &Name, bool AbortOnFailure=true)
This method returns the address of the specified function.
void deregisterEHFrames() override
static uint64_t getSymbolAddressInProcess(const std::string &Name)
This method returns the address of the specified function or variable in the current process...