Bionic loader is no longer hijacking libdl.so
Do not hijack libdl.so methods but make libdl proxy calls to
loader instead. This will be replaces by calls to libc.so
once loader functionality is migrated.
Also add a lock to dl_unwind_find_exidx function call.
Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Bug: http://b/27106625
Change-Id: Ic33a7109a86f4262798d63a35f4c61d15b0068bb
diff --git a/linker/linker.cpp b/linker/linker.cpp
index be4b584..d3ab8d8 100644
--- a/linker/linker.cpp
+++ b/linker/linker.cpp
@@ -324,9 +324,7 @@
// in that section (via *pcount).
//
// Intended to be called by libc's __gnu_Unwind_Find_exidx().
-//
-// This function is exposed via dlfcn.cpp and libdl.so.
-_Unwind_Ptr dl_unwind_find_exidx(_Unwind_Ptr pc, int* pcount) {
+_Unwind_Ptr do_dl_unwind_find_exidx(_Unwind_Ptr pc, int* pcount) {
uintptr_t addr = reinterpret_cast<uintptr_t>(pc);
for (soinfo* si = solist_get_head(); si != 0; si = si->next) {
@@ -1730,8 +1728,9 @@
info->library_namespace : nullptr);
}
-void* do_dlopen(const char* name, int flags, const android_dlextinfo* extinfo,
- void* caller_addr) {
+void* do_dlopen(const char* name, int flags,
+ const android_dlextinfo* extinfo,
+ const void* caller_addr) {
soinfo* const caller = find_containing_library(caller_addr);
android_namespace_t* ns = get_caller_namespace(caller);
@@ -1858,8 +1857,11 @@
return static_cast<soinfo*>(handle);
}
-bool do_dlsym(void* handle, const char* sym_name, const char* sym_ver,
- void* caller_addr, void** symbol) {
+bool do_dlsym(void* handle,
+ const char* sym_name,
+ const char* sym_ver,
+ const void* caller_addr,
+ void** symbol) {
#if !defined(__LP64__)
if (handle == nullptr) {
DL_ERR("dlsym failed: library handle is null");