00c0d4
commit eb77a1fccc7e60cea32245c11288c7f1d92545fa
00c0d4
Author: Florian Weimer <fweimer@redhat.com>
00c0d4
Date:   Wed Oct 16 18:19:51 2019 +0200
00c0d4
00c0d4
    dlfcn: Remove remnants of caller sensitivity from dlinfo
00c0d4
    
00c0d4
    dlinfo operates on a specific handle, which means that there is no
00c0d4
    caller sensivity involved.
00c0d4
00c0d4
diff --git a/dlfcn/dlinfo.c b/dlfcn/dlinfo.c
00c0d4
index 964572cc670ceba4..23ef3f57ca41afdf 100644
00c0d4
--- a/dlfcn/dlinfo.c
00c0d4
+++ b/dlfcn/dlinfo.c
00c0d4
@@ -26,7 +26,7 @@
00c0d4
 int
00c0d4
 dlinfo (void *handle, int request, void *arg)
00c0d4
 {
00c0d4
-  return __dlinfo (handle, request, arg, RETURN_ADDRESS (0));
00c0d4
+  return __dlinfo (handle, request, arg);
00c0d4
 }
00c0d4
 
00c0d4
 #else
00c0d4
@@ -35,7 +35,6 @@ dlinfo (void *handle, int request, void *arg)
00c0d4
 
00c0d4
 struct dlinfo_args
00c0d4
 {
00c0d4
-  ElfW(Addr) caller;
00c0d4
   void *handle;
00c0d4
   int request;
00c0d4
   void *arg;
00c0d4
@@ -47,24 +46,6 @@ dlinfo_doit (void *argsblock)
00c0d4
   struct dlinfo_args *const args = argsblock;
00c0d4
   struct link_map *l = args->handle;
00c0d4
 
00c0d4
-# if 0
00c0d4
-  if (args->handle == RTLD_SELF)
00c0d4
-    {
00c0d4
-      Lmid_t nsid;
00c0d4
-
00c0d4
-      /* Find the highest-addressed object that CALLER is not below.  */
00c0d4
-      for (nsid = 0; nsid < DL_NNS; ++nsid)
00c0d4
-	for (l = GL(dl_ns)[nsid]._ns_loaded; l != NULL; l = l->l_next)
00c0d4
-	  if (caller >= l->l_map_start && caller < l->l_map_end
00c0d4
-	      && (l->l_contiguous || _dl_addr_inside_object (l, caller)))
00c0d4
-	    break;
00c0d4
-
00c0d4
-      if (l == NULL)
00c0d4
-	_dl_signal_error (0, NULL, NULL, N_("\
00c0d4
-RTLD_SELF used in code not dynamically loaded"));
00c0d4
-    }
00c0d4
-# endif
00c0d4
-
00c0d4
   switch (args->request)
00c0d4
     {
00c0d4
     case RTLD_DI_CONFIGADDR:
00c0d4
@@ -108,16 +89,14 @@ RTLD_SELF used in code not dynamically loaded"));
00c0d4
 }
00c0d4
 
00c0d4
 int
00c0d4
-__dlinfo (void *handle, int request, void *arg DL_CALLER_DECL)
00c0d4
+__dlinfo (void *handle, int request, void *arg)
00c0d4
 {
00c0d4
 # ifdef SHARED
00c0d4
   if (!rtld_active ())
00c0d4
-    return _dlfcn_hook->dlinfo (handle, request, arg,
00c0d4
-				DL_CALLER);
00c0d4
+    return _dlfcn_hook->dlinfo (handle, request, arg);
00c0d4
 # endif
00c0d4
 
00c0d4
-  struct dlinfo_args args = { (ElfW(Addr)) DL_CALLER,
00c0d4
-			      handle, request, arg };
00c0d4
+  struct dlinfo_args args = { handle, request, arg };
00c0d4
   return _dlerror_run (&dlinfo_doit, &args) ? -1 : 0;
00c0d4
 }
00c0d4
 # ifdef SHARED
00c0d4
diff --git a/include/dlfcn.h b/include/dlfcn.h
00c0d4
index 0dc57dbe2217cfe7..93dd369ab12a5745 100644
00c0d4
--- a/include/dlfcn.h
00c0d4
+++ b/include/dlfcn.h
00c0d4
@@ -117,7 +117,7 @@ struct dlfcn_hook
00c0d4
   int (*dladdr) (const void *address, Dl_info *info);
00c0d4
   int (*dladdr1) (const void *address, Dl_info *info,
00c0d4
 		  void **extra_info, int flags);
00c0d4
-  int (*dlinfo) (void *handle, int request, void *arg, void *dl_caller);
00c0d4
+  int (*dlinfo) (void *handle, int request, void *arg);
00c0d4
   void *(*dlmopen) (Lmid_t nsid, const char *file, int mode, void *dl_caller);
00c0d4
   void *pad[4];
00c0d4
 };
00c0d4
@@ -143,8 +143,7 @@ extern int __dladdr (const void *address, Dl_info *info)
00c0d4
 extern int __dladdr1 (const void *address, Dl_info *info,
00c0d4
 		      void **extra_info, int flags)
00c0d4
      attribute_hidden;
00c0d4
-extern int __dlinfo (void *handle, int request, void *arg DL_CALLER_DECL)
00c0d4
-     attribute_hidden;
00c0d4
+extern int __dlinfo (void *handle, int request, void *arg) attribute_hidden;
00c0d4
 
00c0d4
 #ifndef SHARED
00c0d4
 struct link_map;