diff --git a/linker/dlfcn.cpp b/linker/dlfcn.cpp index 7bcb59f16..6d63ad646 100644 --- a/linker/dlfcn.cpp +++ b/linker/dlfcn.cpp @@ -65,10 +65,9 @@ void android_update_LD_LIBRARY_PATH(const char* ld_library_path) { do_android_update_LD_LIBRARY_PATH(ld_library_path); } -static void* dlopen_ext(const char* filename, int flags, const android_dlextinfo* extinfo, const void* caller_addr) { +static void* dlopen_ext(const char* filename, int flags, const android_dlextinfo* extinfo) { ScopedPthreadMutexLocker locker(&g_dl_mutex); - soinfo* caller_soinfo = find_containing_library(caller_addr); - soinfo* result = do_dlopen(filename, flags, caller_soinfo, extinfo); + soinfo* result = do_dlopen(filename, flags, extinfo); if (result == NULL) { __bionic_format_dlerror("dlopen failed", linker_get_error_buffer()); return NULL; @@ -77,13 +76,11 @@ static void* dlopen_ext(const char* filename, int flags, const android_dlextinfo } void* android_dlopen_ext(const char* filename, int flags, const android_dlextinfo* extinfo) { - void* caller_addr = __builtin_return_address(0); - return dlopen_ext(filename, flags, extinfo, caller_addr); + return dlopen_ext(filename, flags, extinfo); } void* dlopen(const char* filename, int flags) { - void* caller_addr = __builtin_return_address(0); - return dlopen_ext(filename, flags, NULL, caller_addr); + return dlopen_ext(filename, flags, NULL); } void* dlsym(void* handle, const char* symbol) { @@ -258,4 +255,3 @@ soinfo* get_libdl_info() { return &__libdl_info; } - diff --git a/linker/linker.cpp b/linker/linker.cpp index 5452f3011..a22233dc6 100644 --- a/linker/linker.cpp +++ b/linker/linker.cpp @@ -827,7 +827,7 @@ void do_android_update_LD_LIBRARY_PATH(const char* ld_library_path) { } } -soinfo* do_dlopen(const char* name, int flags, soinfo* /*caller*/, const android_dlextinfo* extinfo) { +soinfo* do_dlopen(const char* name, int flags, const android_dlextinfo* extinfo) { if ((flags & ~(RTLD_NOW|RTLD_LAZY|RTLD_LOCAL|RTLD_GLOBAL|RTLD_NOLOAD)) != 0) { DL_ERR("invalid flags to dlopen: %x", flags); return NULL; diff --git a/linker/linker.h b/linker/linker.h index 9d4099d81..0a72d9256 100644 --- a/linker/linker.h +++ b/linker/linker.h @@ -231,7 +231,7 @@ extern soinfo* get_libdl_info(); void do_android_get_LD_LIBRARY_PATH(char*, size_t); void do_android_update_LD_LIBRARY_PATH(const char* ld_library_path); -soinfo* do_dlopen(const char* name, int flags, soinfo* caller, const android_dlextinfo* extinfo); +soinfo* do_dlopen(const char* name, int flags, const android_dlextinfo* extinfo); void do_dlclose(soinfo* si); ElfW(Sym)* dlsym_linear_lookup(const char* name, soinfo** found, soinfo* start);