this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

initLD() now called manually, the previous method caused init order problems

+7 -2
+4
src/dyld/MachOLoader.cpp
··· 41 41 #include <unistd.h> 42 42 #include <dlfcn.h> 43 43 #include <libgen.h> 44 + #include <pthread.h> 44 45 #include "eh/EHSection.h" 45 46 #include "TLS.h" 46 47 ··· 91 92 TrampolineMgr::loadFunctionInfo(info); 92 93 } 93 94 #endif 95 + 96 + static pthread_once_t once_control = PTHREAD_ONCE_INIT; 97 + pthread_once(&once_control, Darling::initLD); 94 98 } 95 99 96 100 MachOLoader::~MachOLoader()
+2 -2
src/dyld/ld.cpp
··· 58 58 59 59 static void* attemptDlopen(const char* filename, int flag); 60 60 static int translateFlags(int flags); 61 - __attribute__((constructor)) static void initLD(); 61 + 62 62 static std::list<Darling::DlsymHookFunc> g_dlsymHooks; 63 63 64 64 static void* g_libStdCxxDarwin = nullptr; ··· 118 118 globfree(&globbuf); 119 119 } 120 120 121 - static void initLD() 121 + void Darling::initLD() 122 122 { 123 123 int rv = regcomp(&g_reFrameworkPath, "/System/Library/Frameworks/([a-zA-Z0-9\\.]+)/Versions/([a-zA-Z0-9\\.]+)/.*", REG_EXTENDED); 124 124 assert(rv == 0);
+1
src/dyld/ld.h
··· 94 94 void registerDlsymHook(DlsymHookFunc func); 95 95 void deregisterDlsymHook(DlsymHookFunc func); 96 96 void* DlopenWithContext(const char* filename, int flag, const std::vector<std::string>& rpaths, bool* notFoundError = nullptr); 97 + void initLD(); 97 98 }; 98 99 99 100 #endif