aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-lookup.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-06-20 03:19:13 +0000
committerUlrich Drepper <drepper@redhat.com>2007-06-20 03:19:13 +0000
commite4eb675d0caf19581b69fd41e9fa29ecc7f22d23 (patch)
tree9e9ffe1d6e2c3a6f9f5dd93838e99cc29fbe81a3 /elf/dl-lookup.c
parent9be09e060fcb211d3e53fc93098f57b74df2cb67 (diff)
downloadglibc-e4eb675d0caf19581b69fd41e9fa29ecc7f22d23.zip
glibc-e4eb675d0caf19581b69fd41e9fa29ecc7f22d23.tar.gz
glibc-e4eb675d0caf19581b69fd41e9fa29ecc7f22d23.tar.bz2
* elf/dl-close.c (free_mem): Free _dl_scope_free_list.
2007-06-13 Jakub Jelinek <jakub@redhat.com> * include/link.h: Don't include rtld-lowlevel.h. (struct link_map): Remove l_scope_lock. * sysdeps/generic/ldsodefs.h: Don't include rtld-lowlevel.h. (_dl_scope_free_list): New field (variable) in _rtld_global. (DL_LOOKUP_SCOPE_LOCK): Remove. (_dl_scope_free): New prototype. * elf/dl-runtime.c (_dl_fixup): Don't use __rtld_mrlock_*lock. Don't pass DL_LOOKUP_SCOPE_LOCK to _dl_lookup_symbol_x. (_dl_profile_fixup): Likewise. * elf/dl-sym.c (do_sym): Likewise. Use wrapped _dl_lookup_symbol_x whenever !RTLD_SINGLE_THREAD_P, use THREAD_GSCOPE_SET_FLAG and THREAD_GSCOPE_RESET_FLAG around it. * elf/dl-close.c (_dl_close_worker): Don't use __rtld_mrlock_{change,done}. Call _dl_scope_free on the old scope. Make sure THREAD_GSCOPE_WAIT () happens if any old scopes were queued or if l_scope_mem has been abandoned. * elf/dl-open.c (_dl_scope_free): New function. (dl_open_worker): Use it. Don't use __rtld_mrlock_{change,done}. * elf/dl-support.c (_dl_scope_free_list): New variable. * elf/dl-lookup.c (add_dependency): Remove flags argument. Remove DL_LOOKUP_SCOPE_LOCK handling. (_dl_lookup_symbol_x): Adjust caller. Remove DL_LOOKUP_SCOPE_LOCK handling. * elf/dl-object.c (_dl_new_object): Don't use __rtld_mrlock_initialize. 2007-06-19 Ulrich Drepper <drepper@redhat.com>
Diffstat (limited to 'elf/dl-lookup.c')
-rw-r--r--elf/dl-lookup.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c
index dc1b865..f4e5ce8 100644
--- a/elf/dl-lookup.c
+++ b/elf/dl-lookup.c
@@ -86,7 +86,7 @@ dl_new_hash (const char *s)
/* Add extra dependency on MAP to UNDEF_MAP. */
static int
internal_function
-add_dependency (struct link_map *undef_map, struct link_map *map, int flags)
+add_dependency (struct link_map *undef_map, struct link_map *map)
{
struct link_map **list;
struct link_map *runp;
@@ -99,18 +99,8 @@ add_dependency (struct link_map *undef_map, struct link_map *map, int flags)
if (undef_map == map)
return 0;
- /* Make sure nobody can unload the object while we are at it.
- If we hold a scope lock drop it now to avoid ABBA locking problems. */
- if ((flags & DL_LOOKUP_SCOPE_LOCK) != 0 && !RTLD_SINGLE_THREAD_P)
- {
- __rtld_mrlock_unlock (undef_map->l_scope_lock);
-
- __rtld_lock_lock_recursive (GL(dl_load_lock));
-
- __rtld_mrlock_lock (undef_map->l_scope_lock);
- }
- else
- __rtld_lock_lock_recursive (GL(dl_load_lock));
+ /* Make sure nobody can unload the object while we are at it. */
+ __rtld_lock_lock_recursive (GL(dl_load_lock));
/* Avoid references to objects which cannot be unloaded anyway. */
if (map->l_type != lt_loaded
@@ -237,10 +227,9 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
bump_num_relocations ();
- /* No other flag than DL_LOOKUP_ADD_DEPENDENCY and DL_LOOKUP_SCOPE_LOCK
- is allowed if we look up a versioned symbol. */
- assert (version == NULL || (flags & ~(DL_LOOKUP_ADD_DEPENDENCY
- | DL_LOOKUP_SCOPE_LOCK)) == 0);
+ /* No other flag than DL_LOOKUP_ADD_DEPENDENCY is allowed if we look
+ up a versioned symbol. */
+ assert (version == NULL || (flags & ~(DL_LOOKUP_ADD_DEPENDENCY)) == 0);
size_t i = 0;
if (__builtin_expect (skip_map != NULL, 0))
@@ -346,13 +335,11 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
runtime lookups. */
&& (flags & DL_LOOKUP_ADD_DEPENDENCY) != 0
/* Add UNDEF_MAP to the dependencies. */
- && add_dependency (undef_map, current_value.m, flags) < 0)
+ && add_dependency (undef_map, current_value.m) < 0)
/* Something went wrong. Perhaps the object we tried to reference
was just removed. Try finding another definition. */
- return _dl_lookup_symbol_x (undef_name, undef_map, ref,
- (flags & DL_LOOKUP_SCOPE_LOCK) == 0
- ? symbol_scope : undef_map->l_scope, version,
- type_class, flags, skip_map);
+ return _dl_lookup_symbol_x (undef_name, undef_map, ref, symbol_scope,
+ version, type_class, flags, skip_map);
/* The object is used. */
current_value.m->l_used = 1;