]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/platform-bionic.git/blobdiff - linker/dlfcn.cpp
Support gethostbyname_r_ERANGE.
[android-sdk/platform-bionic.git] / linker / dlfcn.cpp
index 799284ee7d8c97e83e456e6c3b90a134d88c9cb6..7ef94c059e438f59d4c69f9be26a8e2a084ffcca 100644 (file)
@@ -29,7 +29,7 @@
 
 /* This file hijacks the symbols stubbed out in libdl.so. */
 
-static pthread_mutex_t g_dl_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER;
+static pthread_mutex_t g_dl_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
 
 static const char* __bionic_set_dlerror(char* new_value) {
   char** dlerror_slot = &reinterpret_cast<char**>(__get_tls())[TLS_SLOT_DLERROR];
@@ -236,16 +236,17 @@ static soinfo __libdl_info("libdl.so", nullptr, 0, RTLD_GLOBAL);
 
 // This is used by the dynamic linker. Every process gets these symbols for free.
 soinfo* get_libdl_info() {
-  if ((__libdl_info.flags & FLAG_LINKED) == 0) {
-    __libdl_info.flags |= FLAG_LINKED;
-    __libdl_info.strtab = ANDROID_LIBDL_STRTAB;
-    __libdl_info.symtab = g_libdl_symtab;
-    __libdl_info.nbucket = sizeof(g_libdl_buckets)/sizeof(unsigned);
-    __libdl_info.nchain = sizeof(g_libdl_chains)/sizeof(unsigned);
-    __libdl_info.bucket = g_libdl_buckets;
-    __libdl_info.chain = g_libdl_chains;
-    __libdl_info.ref_count = 1;
-    __libdl_info.strtab_size = sizeof(ANDROID_LIBDL_STRTAB);
+  if ((__libdl_info.flags_ & FLAG_LINKED) == 0) {
+    __libdl_info.flags_ |= FLAG_LINKED;
+    __libdl_info.strtab_ = ANDROID_LIBDL_STRTAB;
+    __libdl_info.symtab_ = g_libdl_symtab;
+    __libdl_info.nbucket_ = sizeof(g_libdl_buckets)/sizeof(unsigned);
+    __libdl_info.nchain_ = sizeof(g_libdl_chains)/sizeof(unsigned);
+    __libdl_info.bucket_ = g_libdl_buckets;
+    __libdl_info.chain_ = g_libdl_chains;
+    __libdl_info.ref_count_ = 1;
+    __libdl_info.strtab_size_ = sizeof(ANDROID_LIBDL_STRTAB);
+    __libdl_info.local_group_root_ = &__libdl_info;
   }
 
   return &__libdl_info;