summaryrefslogtreecommitdiff
path: root/elf/dl-close.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-05-19 07:08:23 +0000
committerUlrich Drepper <drepper@redhat.com>2007-05-19 07:08:23 +0000
commitdf94b6412e0628cd577da0ce5626358a3967ee44 (patch)
tree3b969d3e4175fe3a72f824c482d8c9f9a3b3bf3e /elf/dl-close.c
parent2acd01acb10d0c0113f87bf7e787e0854498269d (diff)
* elf/dl-close.c (_dl_close_worker): When removing object from
global scope, wait for all lookups to finish afterwards. * elf/dl-open.c (add_to_global): When global scope array must grow, allocate a new one and free old array only after all lookups finish. * elf/dl-runtime.c (_dl_fixup): Protect using global scope. (_dl_lookup_symbol_x): Likewise. * elf/dl-support.c: Define _dl_wait_lookup_done. * sysdeps/generic/ldsodefs.h (struct rtld_global): Add _dl_wait_lookup_done.
Diffstat (limited to 'elf/dl-close.c')
-rw-r--r--elf/dl-close.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/elf/dl-close.c b/elf/dl-close.c
index e0fe26ad02..8e5c9fc033 100644
--- a/elf/dl-close.c
+++ b/elf/dl-close.c
@@ -31,6 +31,7 @@
#include <sys/types.h>
#include <sys/mman.h>
#include <sysdep-cancel.h>
+#include <tls.h>
/* Type of the constructor functions. */
@@ -487,6 +488,9 @@ _dl_close_worker (struct link_map *map)
ns_msl->r_list[cnt - 1] = ns_msl->r_list[cnt];
--ns_msl->r_nlist;
+
+ if (!RTLD_SINGLE_THREAD_P)
+ THREAD_GSCOPE_WAIT ();
}
/* Remove the object from the dtv slotinfo array if it uses TLS. */