about summary refs log tree commit diff
path: root/elf/dl-open.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-07-09 23:52:22 -0700
committerUlrich Drepper <drepper@redhat.com>2009-07-09 23:52:22 -0700
commit415ac3df9b10ae426d4f71f9d48003f6a3c7bd8d (patch)
treeffdd1aed425688539db80ff7b9daf6f6ddbcbfff /elf/dl-open.c
parentb4f55afd031f14531ba7681032fc5f75a1578320 (diff)
downloadglibc-415ac3df9b10ae426d4f71f9d48003f6a3c7bd8d.tar.gz
glibc-415ac3df9b10ae426d4f71f9d48003f6a3c7bd8d.tar.xz
glibc-415ac3df9b10ae426d4f71f9d48003f6a3c7bd8d.zip
Implement STB_GNU_UNIQUE handling.
Some symbols have to be identified process-wide by their name.  This is
particularly important for some C++ features (e.g., class local static data
and static variables in inline functions).  This cannot completely be
implemented with ELF functionality so far.  The STB_GNU_UNIQUE binding
helps by ensuring the dynamic linker will always use the same definition for
all symbols with the same name and this binding.
Diffstat (limited to 'elf/dl-open.c')
-rw-r--r--elf/dl-open.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index c3f0e42d5e..b8ebfe0e60 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -569,7 +569,7 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
 	if (GL(dl_ns)[nsid]._ns_loaded == NULL)
 	  break;
 
-      if (nsid == DL_NNS)
+      if (__builtin_expect (nsid == DL_NNS, 0))
 	{
 	  /* No more namespace available.  */
 	  __rtld_lock_unlock_recursive (GL(dl_load_lock));
@@ -579,7 +579,10 @@ no more namespaces available for dlmopen()"));
 	}
 
       if (nsid == GL(dl_nns))
-	++GL(dl_nns);
+	{
+	  __rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
+	  ++GL(dl_nns);
+	}
 
       _dl_debug_initialize (0, nsid)->r_state = RT_CONSISTENT;
     }