about summary refs log tree commit diff
path: root/dlfcn/dlinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'dlfcn/dlinfo.c')
-rw-r--r--dlfcn/dlinfo.c45
1 files changed, 25 insertions, 20 deletions
diff --git a/dlfcn/dlinfo.c b/dlfcn/dlinfo.c
index 9fb2a1405c..15fcbc5dc1 100644
--- a/dlfcn/dlinfo.c
+++ b/dlfcn/dlinfo.c
@@ -20,18 +20,8 @@
 #include <link.h>
 #include <ldsodefs.h>
 #include <libintl.h>
-
-#if !defined SHARED && IS_IN (libdl)
-
-int
-dlinfo (void *handle, int request, void *arg)
-{
-  return __dlinfo (handle, request, arg);
-}
-
-#else
-
-# include <dl-tls.h>
+#include <dl-tls.h>
+#include <shlib-compat.h>
 
 struct dlinfo_args
 {
@@ -88,18 +78,33 @@ dlinfo_doit (void *argsblock)
     }
 }
 
+static int
+dlinfo_implementation (void *handle, int request, void *arg)
+{
+  struct dlinfo_args args = { handle, request, arg };
+  return _dlerror_run (&dlinfo_doit, &args) ? -1 : 0;
+}
+
+#ifdef SHARED
 int
-__dlinfo (void *handle, int request, void *arg)
+___dlinfo (void *handle, int request, void *arg)
 {
-# ifdef SHARED
   if (!rtld_active ())
     return _dlfcn_hook->dlinfo (handle, request, arg);
-# endif
-
-  struct dlinfo_args args = { handle, request, arg };
-  return _dlerror_run (&dlinfo_doit, &args) ? -1 : 0;
+  else
+    return dlinfo_implementation (handle, request, arg);
 }
-# ifdef SHARED
-strong_alias (__dlinfo, dlinfo)
+versioned_symbol (libc, ___dlinfo, dlinfo, GLIBC_2_34);
+
+# if OTHER_SHLIB_COMPAT (libdl, GLIBC_2_3_3, GLIBC_2_34)
+compat_symbol (libc, ___dlinfo, dlinfo, GLIBC_2_3_3);
 # endif
+#else /* !SHARED */
+/* Also used with _dlfcn_hook.  */
+int
+__dlinfo (void *handle, int request, void *arg)
+{
+  return dlinfo_implementation (handle, request, arg);
+}
+weak_alias (__dlinfo, dlinfo)
 #endif