linker: print "not accessible" error message to the log
Print properties of the namespace on "library is not accessible"
error to better diagnose problems with native library accessiblity
Bug: http://b/27406143
Change-Id: Icf3d6c604f09dfa015de863fdb1267d343930d2a
diff --git a/tests/dlext_test.cpp b/tests/dlext_test.cpp
index c64ec15..66d8859 100644
--- a/tests/dlext_test.cpp
+++ b/tests/dlext_test.cpp
@@ -799,7 +799,9 @@
// Check dlopen by absolute path
handle2 = android_dlopen_ext(lib_private_external_path.c_str(), RTLD_NOW, &extinfo);
ASSERT_TRUE(handle2 == nullptr);
- ASSERT_EQ("dlopen failed: library \"" + lib_private_external_path + "\" is not accessible for the namespace \"private_isolated1\"", dlerror());
+ ASSERT_EQ("dlopen failed: library \"" + lib_private_external_path + "\" needed"
+ " or dlopened by \"" + get_executable_name() + "\" is not accessible"
+ " for the namespace \"private_isolated1\"", dlerror());
extinfo.library_namespace = ns_isolated2;
@@ -899,7 +901,9 @@
// Check dlopen by absolute path
handle2 = android_dlopen_ext(lib_private_external_path.c_str(), RTLD_NOW, &extinfo);
ASSERT_TRUE(handle2 == nullptr);
- ASSERT_EQ("dlopen failed: library \"" + lib_private_external_path + "\" is not accessible for the namespace \"private_isolated_shared\"", dlerror());
+ ASSERT_EQ("dlopen failed: library \"" + lib_private_external_path + "\" needed"
+ " or dlopened by \"" + get_executable_name() + "\" is not accessible"
+ " for the namespace \"private_isolated_shared\"", dlerror());
// load libnstest_root.so to shared namespace in order to check that everything is different
// except shared libnstest_dlopened.so