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