summary refs log tree commit diff
path: root/elf/dl-support.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-support.c')
-rw-r--r--elf/dl-support.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/elf/dl-support.c b/elf/dl-support.c
index 8201ced490..68973cc5c1 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -25,6 +25,7 @@
 #include <unistd.h>
 #include <ldsodefs.h>
 #include <dl-machine.h>
+#include <bits/libc-lock.h>
 
 extern char *__progname;
 char **_dl_argv = &__progname;	/* This is checked for some error messages.  */
@@ -81,6 +82,15 @@ struct r_scope_elem *_dl_main_searchlist = &_dl_initial_searchlist;
 /* Nonzero during startup.  */
 int _dl_starting_up = 1;
 
+/* During the program run we must not modify the global data of
+   loaded shared object simultanously in two threads.  Therefore we
+   protect `_dl_open' and `_dl_close' in dl-close.c.
+
+   This must be a recursive lock since the initializer function of
+   the loaded object might as well require a call to this function.
+   At this time it is not anymore a problem to modify the tables.  */
+__libc_lock_define_initialized_recursive (, _dl_load_lock)
+
 
 static void non_dynamic_init (void) __attribute__ ((unused));