From 6dfc0207ebeb639e47ba7387a9123ed622904cf7 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 3 Jun 2021 08:26:04 +0200 Subject: dlfcn: Move dlinfo into libc The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella --- dlfcn/dlinfo.c | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'dlfcn/dlinfo.c') 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 #include #include - -#if !defined SHARED && IS_IN (libdl) - -int -dlinfo (void *handle, int request, void *arg) -{ - return __dlinfo (handle, request, arg); -} - -#else - -# include +#include +#include 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 -- cgit v1.2.3