about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--elf/dl-sym.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9cd77f9430..c95449cbb5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-10-23  Ulrich Drepper  <drepper@redhat.com>
+
+	* elf/dl-sym.c (_dl_sym): For RTLD_DEFAULT, search in objects
+	global scope if we can determine it.
+
 2000-10-23  Andreas Schwab  <schwab@suse.de>
 
 	* sysdeps/unix/sysv/linux/ia64/bits/resource.h (RLIMIT_LOCKS): Added.
diff --git a/elf/dl-sym.c b/elf/dl-sym.c
index 873865698c..954741b365 100644
--- a/elf/dl-sym.c
+++ b/elf/dl-sym.c
@@ -42,8 +42,13 @@ _dl_sym (void *handle, const char *name, void *who)
       match = l;
 
   if (handle == RTLD_DEFAULT)
-    /* Search the global scope.  */
-    result = _dl_lookup_symbol (name, match, &ref, _dl_global_scope, 0, 0);
+    {
+      /* Search the global scope as seen in the caller object.  */
+      if (match != NULL)
+	result = _dl_lookup_symbol (name, match, &ref, match->l_scope, 0, 0);
+      else
+	result = _dl_lookup_symbol (name, match, &ref, _dl_global_scope, 0, 0);
+    }
   else
     {
       if (handle != RTLD_NEXT)