linker: fix error message for inaccessible libs

Added a test to make sure linker produces correct error message
when user attempts to load a library in a linked namespace and fails.

Bug: http://b/67866190
Bug: http://b/64950640
Bug: http://b/64888291
Test: bionic-unit-test --gtest_filter=dlext*
Change-Id: I5b5c2070d1388eff123118350b2b5c8fc7571a29
diff --git a/tests/libs/Android.bp b/tests/libs/Android.bp
index ba0b1aa..5f27387 100644
--- a/tests/libs/Android.bp
+++ b/tests/libs/Android.bp
@@ -440,6 +440,16 @@
 }
 
 // -----------------------------------------------------------------------------
+// Library for inaccessible shared library test
+// -----------------------------------------------------------------------------
+cc_test_library {
+    name: "libtestshared",
+    defaults: ["bionic_testlib_defaults"],
+    srcs: ["empty.cpp"],
+    relative_install_path: "/inaccessible_libs",
+}
+
+// -----------------------------------------------------------------------------
 // Library with weak undefined function
 // -----------------------------------------------------------------------------
 cc_test_library {