diff options
69 files changed, 120 insertions, 54 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" diff --git a/include/dlfcn.h b/include/dlfcn.h index dc5193acbb..e898c17792 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -143,7 +143,7 @@ extern void *__dlvsym (void *handle, const char *name, const char *version extern int __dladdr (const void *address, Dl_info *info); extern int __dladdr1 (const void *address, Dl_info *info, void **extra_info, int flags); -extern int __dlinfo (void *handle, int request, void *arg) attribute_hidden; +extern int __dlinfo (void *handle, int request, void *arg); #ifndef SHARED struct link_map; diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 172e269fe9..f4adfc6e5f 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -2145,6 +2145,7 @@ GLIBC_2.3.2 setresgid F GLIBC_2.3.2 setresuid F GLIBC_2.3.2 strptime_l F GLIBC_2.3.3 dladdr1 F +GLIBC_2.3.3 dlinfo F GLIBC_2.3.3 inet6_option_alloc F GLIBC_2.3.3 inet6_option_append F GLIBC_2.3.3 inet6_option_find F @@ -2217,6 +2218,7 @@ GLIBC_2.34 dladdr F GLIBC_2.34 dladdr1 F GLIBC_2.34 dlclose F GLIBC_2.34 dlerror F +GLIBC_2.34 dlinfo F GLIBC_2.34 dlmopen F GLIBC_2.34 dlsym F GLIBC_2.34 execveat F diff --git a/sysdeps/mach/hurd/i386/libdl.abilist b/sysdeps/mach/hurd/i386/libdl.abilist index 9e890a9815..3a60902d2a 100644 --- a/sysdeps/mach/hurd/i386/libdl.abilist +++ b/sysdeps/mach/hurd/i386/libdl.abilist @@ -1,4 +1,4 @@ GLIBC_2.2.6 dlopen F GLIBC_2.2.6 dlvsym F -GLIBC_2.3.3 dlinfo F +GLIBC_2.3.3 __libdl_version_placeholder F GLIBC_2.3.4 __libdl_version_placeholder F diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index f09046237f..a962e2966c 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/ |
