about summary refs log tree commit diff
path: root/dlfcn/dlinfo.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-06-03 08:26:04 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-06-03 08:26:04 +0200
commit6dfc0207ebeb639e47ba7387a9123ed622904cf7 (patch)
tree2206f40e0eaf0c3386bc31334668857f6c39967d /dlfcn/dlinfo.c
parent492560a32e14c9a985274e1995b67a577197261e (diff)
downloadglibc-6dfc0207ebeb639e47ba7387a9123ed622904cf7.tar.gz
glibc-6dfc0207ebeb639e47ba7387a9123ed622904cf7.tar.xz
glibc-6dfc0207ebeb639e47ba7387a9123ed622904cf7.zip
dlfcn: Move dlinfo into libc
The symbol was moved using scripts/move-symbol-to-libc.py.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
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