diff options
author | Florian Weimer <fweimer@redhat.com> | 2021-06-03 08:26:04 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2021-06-03 08:26:04 +0200 |
commit | 6dfc0207ebeb639e47ba7387a9123ed622904cf7 (patch) | |
tree | 2206f40e0eaf0c3386bc31334668857f6c39967d /dlfcn | |
parent | 492560a32e14c9a985274e1995b67a577197261e (diff) | |
download | glibc-6dfc0207ebeb639e47ba7387a9123ed622904cf7.tar glibc-6dfc0207ebeb639e47ba7387a9123ed622904cf7.tar.gz glibc-6dfc0207ebeb639e47ba7387a9123ed622904cf7.tar.bz2 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')
-rw-r--r-- | dlfcn/Makefile | 3 | ||||
-rw-r--r-- | dlfcn/Versions | 4 | ||||
-rw-r--r-- | dlfcn/dlfcn.c | 6 | ||||
-rw-r--r-- | dlfcn/dlinfo.c | 45 | ||||
-rw-r--r-- | dlfcn/sdlinfo.c | 1 |
5 files changed, 36 insertions, 23 deletions
diff --git a/dlfcn/Makefile b/dlfcn/Makefile index 1dfa247538..c65cdc2e2b 100644 --- a/dlfcn/Makefile +++ b/dlfcn/Makefile @@ -21,7 +21,7 @@ include ../Makeconfig headers := bits/dlfcn.h dlfcn.h extra-libs := libdl -libdl-routines := dlopen dlvsym dlinfo \ +libdl-routines := dlopen dlvsym \ dlfcn routines := $(patsubst %,s%,$(filter-out dlfcn,$(libdl-routines))) elide-routines.os := $(routines) @@ -30,6 +30,7 @@ routines += \ dladdr1 \ dlclose \ dlerror \ + dlinfo \ dlmopen \ dlsym \ libc_dlerror_result \ diff --git a/dlfcn/Versions b/dlfcn/Versions index acd9402b34..ca9a3e5591 100644 --- a/dlfcn/Versions +++ b/dlfcn/Versions @@ -7,6 +7,7 @@ libc { } GLIBC_2.3.3 { dladdr1; + dlinfo; } GLIBC_2.3.4 { dlmopen; @@ -16,6 +17,7 @@ libc { dladdr; dlclose; dlerror; + dlinfo; dlmopen; dlsym; } @@ -33,7 +35,7 @@ libdl { dlopen; dlvsym; } GLIBC_2.3.3 { - dlinfo; + __libdl_version_placeholder; } GLIBC_2.3.4 { __libdl_version_placeholder; diff --git a/dlfcn/dlfcn.c b/dlfcn/dlfcn.c index 90cdee0903..55ecfcabbe 100644 --- a/dlfcn/dlfcn.c +++ b/dlfcn/dlfcn.c @@ -48,6 +48,12 @@ __libdl_version_placeholder_1 (void) { } +#if SHLIB_COMPAT (libdl, GLIBC_2_3_3, GLIBC_2_34) \ + && ABI_libdl_GLIBC_2_3_3 != ABI_libdl_GLIBC_2_1 +compat_symbol (libdl, __libdl_version_placeholder_1, + __libdl_version_placeholder, GLIBC_2_3_3); +#endif + #if SHLIB_COMPAT (libdl, GLIBC_2_3_4, GLIBC_2_34) \ && ABI_libdl_GLIBC_2_3_4 != ABI_libdl_GLIBC_2_1 compat_symbol (libdl, __libdl_version_placeholder_1, 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 diff --git a/dlfcn/sdlinfo.c b/dlfcn/sdlinfo.c deleted file mode 100644 index dcc257dd1f..0000000000 --- a/dlfcn/sdlinfo.c +++ /dev/null @@ -1 +0,0 @@ -#include "dlinfo.c" |