about summary refs log tree commit diff
path: root/elf/dl-libc.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-08-13 12:47:47 -0400
committerUlrich Drepper <drepper@gmail.com>2011-08-13 12:47:47 -0400
commit1dc277048c82f5445031b9273114a6a5c505abd8 (patch)
tree6f2e37cf450e5f21abe0c2c090d276d493426880 /elf/dl-libc.c
parentf9ddf089f124279836930692b9cd7bc807e60088 (diff)
downloadglibc-1dc277048c82f5445031b9273114a6a5c505abd8.tar.gz
glibc-1dc277048c82f5445031b9273114a6a5c505abd8.tar.xz
glibc-1dc277048c82f5445031b9273114a6a5c505abd8.zip
Fix caller information of NSS modules
Diffstat (limited to 'elf/dl-libc.c')
-rw-r--r--elf/dl-libc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/elf/dl-libc.c b/elf/dl-libc.c
index 7be9483de6..e440d016de 100644
--- a/elf/dl-libc.c
+++ b/elf/dl-libc.c
@@ -1,5 +1,6 @@
 /* Handle loading and unloading shared objects for internal libc purposes.
-   Copyright (C) 1999-2002,2004-2006,2009,2010 Free Software Foundation, Inc.
+   Copyright (C) 1999-2002,2004-2006,2009,2010,2011
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Zack Weinberg <zack@rabi.columbia.edu>, 1999.
 
@@ -62,6 +63,8 @@ struct do_dlopen_args
   const char *name;
   /* Opening mode.  */
   int mode;
+  /* This is the caller of the dlopen() function.  */
+  const void *caller_dlopen;
 
   /* Return from do_dlopen.  */
   struct link_map *map;
@@ -83,8 +86,9 @@ do_dlopen (void *ptr)
 {
   struct do_dlopen_args *args = (struct do_dlopen_args *) ptr;
   /* Open and relocate the shared object.  */
-  args->map = GLRO(dl_open) (args->name, args->mode, NULL, __LM_ID_CALLER,
-			     __libc_argc, __libc_argv, __environ);
+  args->map = GLRO(dl_open) (args->name, args->mode, args->caller_dlopen,
+			     __LM_ID_CALLER, __libc_argc, __libc_argv,
+			     __environ);
 }
 
 static void
@@ -153,6 +157,7 @@ __libc_dlopen_mode (const char *name, int mode)
   struct do_dlopen_args args;
   args.name = name;
   args.mode = mode;
+  args.caller_dlopen = RETURN_ADDRESS (0);
 
 #ifdef SHARED
   if (__builtin_expect (_dl_open_hook != NULL, 0))