summaryrefslogtreecommitdiff
path: root/elf/dl-object.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2010-05-04 12:13:28 -0700
committerRoland McGrath <roland@redhat.com>2010-05-04 12:13:28 -0700
commitbb6d7d23841e57fde2c6c79a4455c7e9373a5d1b (patch)
tree334c4a5d9b11045021021f5f0db53ce4f4fa3ff3 /elf/dl-object.c
parent2e76ab2332a7fb9e73a4047625b915bff93bd427 (diff)
parentc4ccff16e2ff92f84102988bd3a32cd1d2719f3a (diff)
Merge commit 'origin/master' into fedora/master
Diffstat (limited to 'elf/dl-object.c')
-rw-r--r--elf/dl-object.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/elf/dl-object.c b/elf/dl-object.c
index 788e2c07b9..22a163560b 100644
--- a/elf/dl-object.c
+++ b/elf/dl-object.c
@@ -93,6 +93,9 @@ _dl_new_object (char *realname, const char *libname, int type,
new->l_scope = new->l_scope_mem;
new->l_scope_max = sizeof (new->l_scope_mem) / sizeof (new->l_scope_mem[0]);
+ /* We modify the list of loaded objects. */
+ __rtld_lock_lock_recursive (GL(dl_load_write_lock));
+
/* Counter for the scopes we have to handle. */
idx = 0;
@@ -114,6 +117,8 @@ _dl_new_object (char *realname, const char *libname, int type,
new->l_serial = GL(dl_load_adds);
++GL(dl_load_adds);
+ __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
+
/* If we have no loader the new object acts as it. */
if (loader == NULL)
loader = new;