summaryrefslogtreecommitdiff
path: root/elf/dl-iteratephdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-iteratephdr.c')
-rw-r--r--elf/dl-iteratephdr.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/elf/dl-iteratephdr.c b/elf/dl-iteratephdr.c
index fee19f3f04..5f1c20d755 100644
--- a/elf/dl-iteratephdr.c
+++ b/elf/dl-iteratephdr.c
@@ -1,5 +1,5 @@
/* Get loaded objects program headers.
- Copyright (C) 2001-2004, 2006-2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2001-2004, 2006-2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2001.
@@ -26,7 +26,7 @@
static void
cancel_handler (void *arg __attribute__((unused)))
{
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
+ __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
}
hidden_proto (__dl_iterate_phdr)
@@ -38,8 +38,8 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
struct dl_phdr_info info;
int ret = 0;
- /* Make sure we are alone. */
- __rtld_lock_lock_recursive (GL(dl_load_lock));
+ /* Make sure nobody modifies the list of loaded objects. */
+ __rtld_lock_lock_recursive (GL(dl_load_write_lock));
__libc_cleanup_push (cancel_handler, 0);
/* We have to determine the namespace of the caller since this determines
@@ -68,7 +68,6 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
info.dlpi_phnum = l->l_phnum;
info.dlpi_adds = GL(dl_load_adds);
info.dlpi_subs = GL(dl_load_adds) - nloaded;
- info.dlpi_tls_modid = 0;
info.dlpi_tls_data = NULL;
info.dlpi_tls_modid = l->l_tls_modid;
if (info.dlpi_tls_modid != 0)
@@ -80,7 +79,7 @@ __dl_iterate_phdr (int (*callback) (struct dl_phdr_info *info,
/* Release the lock. */
__libc_cleanup_pop (0);
- __rtld_lock_unlock_recursive (GL(dl_load_lock));
+ __rtld_lock_unlock_recursive (GL(dl_load_write_lock));
return ret;
}