(_dl_close_worker): When removing object from global scope, wait for
authordrepper <drepper>
Sat, 19 May 2007 07:07:29 +0000 (07:07 +0000)
committerdrepper <drepper>
Sat, 19 May 2007 07:07:29 +0000 (07:07 +0000)
all lookups to finish afterwards.

elf/dl-close.c

index e0fe26a..8e5c9fc 100644 (file)
@@ -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.  */