Fix dlsym() to take into account RTLD_GLOBAL/LOCAL

  Symbols from libraries opened with RTLD_LOCAL (default)
  should not be visible via dlsym(RLTD_DEFAULT/RTLD_NEXT, .)

Bug: 17512583
Change-Id: I1758943081a67cf3d49ba5808e061b8251a91964
diff --git a/linker/linker.h b/linker/linker.h
index 37d513e..ca96e2f 100644
--- a/linker/linker.h
+++ b/linker/linker.h
@@ -201,7 +201,7 @@
   // should not use it in any way.
   bool has_DT_SYMBOLIC;
 
-  soinfo(const char* name, const struct stat* file_stat);
+  soinfo(const char* name, const struct stat* file_stat, int rtld_flags);
 
   void CallConstructors();
   void CallDestructors();
@@ -217,6 +217,8 @@
   ino_t get_st_ino();
   dev_t get_st_dev();
 
+  int get_rtld_flags();
+
   soinfo_list_t& get_children();
   soinfo_list_t& get_parents();
 
@@ -248,6 +250,7 @@
   soinfo_list_t parents;
 
   // version >= 1
+  int rtld_flags;
 };
 
 extern soinfo* get_libdl_info();