Skip to content
Snippets Groups Projects
Commit c944276c authored by Alexandre Lissy's avatar Alexandre Lissy
Browse files

Bug 1835231 - Use dlopen() wrapper for Android <= 22 r=gsvelto

parent 2fe74ec8
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,14 @@ static inline T dlsym_wrapper(void* aHandle, const char* aName) {
#endif // MOZ_LINKER
}
static inline void* dlopen_wrapper(const char* aPath, int flags) {
#ifdef MOZ_LINKER
return __wrap_dlopen(aPath, flags);
#else
return dlopen(aPath, flags);
#endif // MOZ_LINKER
}
template <typename T>
static T get_real_symbol(const char* aName, T aReplacementSymbol) {
// T can only be a function pointer
......@@ -41,7 +49,7 @@ static T get_real_symbol(const char* aName, T aReplacementSymbol) {
// libc.so. Note that this won't work if we're trying to interpose
// functions that are in other libraries, but hopefully we'll never have
// to do that.
void* handle = dlopen("libc.so", RTLD_LAZY);
void* handle = dlopen_wrapper("libc.so", RTLD_LAZY);
if (handle) {
real_symbol = dlsym_wrapper<T>(handle, aName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment