From 415ac3df9b10ae426d4f71f9d48003f6a3c7bd8d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 9 Jul 2009 23:52:22 -0700 Subject: 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. --- elf/dl-open.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'elf/dl-open.c') 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; } -- cgit 1.4.1