Replace public library list with shared lib sonames (part 2/2)

This commit updates interface of libdl.c.

1. android_init_namespaces is replaces with android_init_anonymous_namespace
2. added 2 arguments to android_create_namespace to specify linked namespace
   and the list of shared libraries sonames.
3. symbol lookup does not get past boundary libraries (added check and test for it).

Bug: http://b/26833548
Bug: http://b/21879602
Test: bionic-unit-tests --gtest_filter=dl*:Dl*
Change-Id: I32921da487a02e5bd0d2fc528904d1228394bfb9
diff --git a/linker/linker_soinfo.cpp b/linker/linker_soinfo.cpp
index 16e42c2..6601dc1 100644
--- a/linker/linker_soinfo.cpp
+++ b/linker/linker_soinfo.cpp
@@ -634,6 +634,11 @@
   secondary_namespaces_.push_back(secondary_ns);
 }
 
+android_namespace_list_t& soinfo::get_secondary_namespaces() {
+  CHECK(has_min_version(3));
+  return secondary_namespaces_;
+}
+
 ElfW(Addr) soinfo::resolve_symbol_address(const ElfW(Sym)* s) const {
   if (ELF_ST_TYPE(s->st_info) == STT_GNU_IFUNC) {
     return call_ifunc_resolver(s->st_value + load_bias);
@@ -695,7 +700,6 @@
   return local_group_root_;
 }
 
-
 void soinfo::set_mapped_by_caller(bool mapped_by_caller) {
   if (mapped_by_caller) {
     flags_ |= FLAG_MAPPED_BY_CALLER;