14 #if defined(HAVE_DLFCN_H) && defined(HAVE_DLOPEN) 25 DynamicLibrary::SearchOrder = DynamicLibrary::SO_Linker;
29 void *Handle = ::dlopen(File, RTLD_LAZY|RTLD_GLOBAL);
31 if (Err) *Err = ::dlerror();
39 Handle = RTLD_DEFAULT;
50 return ::dlsym(Handle, Symbol);
58 if (Err) *Err =
"dlopen() not supported on this platform";
72 static void *DoSearch(
const char*
SymbolName) {
73 #define EXPLICIT_SYMBOL(SYM) \ 74 extern void *SYM; if (!strcmp(SymbolName, #SYM)) return (void*)&SYM 89 EXPLICIT_SYMBOL(__eprintf);
97 EXPLICIT_SYMBOL(_alloca);
98 EXPLICIT_SYMBOL(__main);
102 #undef EXPLICIT_SYMBOL 105 #define EXPLICIT_SYMBOL(SYM) \ 106 if (!strcmp(SymbolName, #SYM)) return &SYM 111 #if defined(__GLIBC__) 113 EXPLICIT_SYMBOL(stderr);
114 EXPLICIT_SYMBOL(stdout);
115 EXPLICIT_SYMBOL(stdin);
122 EXPLICIT_SYMBOL(stdin);
125 EXPLICIT_SYMBOL(stdout);
128 EXPLICIT_SYMBOL(stderr);
132 #undef EXPLICIT_SYMBOL
constexpr char SymbolName[]
Key for Kernel::Metadata::mSymbolName.
static void * DLSym(void *Handle, const char *Symbol)
static void * DLOpen(const char *Filename, std::string *Err)
auto reverse(ContainerTy &&C, typename std::enable_if< has_rbegin< ContainerTy >::value >::type *=nullptr) -> decltype(make_range(C.rbegin(), C.rend()))
static void DLClose(void *Handle)