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