From 602252b553031d49c70467bfebcb1ba3bd264501 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 3 Jun 2021 08:26:04 +0200 Subject: dlfcn: Move dladdr into libc The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella --- dlfcn/Makefile | 3 ++- dlfcn/Versions | 3 ++- dlfcn/dladdr.c | 22 +++++++--------------- dlfcn/sdladdr.c | 1 - 4 files changed, 11 insertions(+), 18 deletions(-) delete mode 100644 dlfcn/sdladdr.c (limited to 'dlfcn') diff --git a/dlfcn/Makefile b/dlfcn/Makefile index 4bdf524492..f0793468c7 100644 --- a/dlfcn/Makefile +++ b/dlfcn/Makefile @@ -21,11 +21,12 @@ include ../Makeconfig headers := bits/dlfcn.h dlfcn.h extra-libs := libdl -libdl-routines := dlopen dlsym dlvsym dladdr dladdr1 dlinfo \ +libdl-routines := dlopen dlsym dlvsym dladdr1 dlinfo \ dlmopen dlfcn routines := $(patsubst %,s%,$(filter-out dlfcn,$(libdl-routines))) elide-routines.os := $(routines) routines += \ + dladdr \ dlclose \ dlerror \ libc_dlerror_result \ diff --git a/dlfcn/Versions b/dlfcn/Versions index d00993afa6..f801fffb87 100644 --- a/dlfcn/Versions +++ b/dlfcn/Versions @@ -1,9 +1,11 @@ libc { GLIBC_2.0 { + dladdr; dlclose; dlerror; } GLIBC_2.34 { + dladdr; dlclose; dlerror; } @@ -15,7 +17,6 @@ libc { } libdl { GLIBC_2.0 { - dladdr; dlopen; dlsym; } diff --git a/dlfcn/dladdr.c b/dlfcn/dladdr.c index 27a6e49cac..3ef1b7f0b6 100644 --- a/dlfcn/dladdr.c +++ b/dlfcn/dladdr.c @@ -18,27 +18,19 @@ #include #include - -#if !defined SHARED && IS_IN (libdl) - -int -dladdr (const void *address, Dl_info *info) -{ - return __dladdr (address, info); -} - -#else +#include int __dladdr (const void *address, Dl_info *info) { -# ifdef SHARED +#ifdef SHARED if (!rtld_active ()) return _dlfcn_hook->dladdr (address, info); -# endif +#endif return _dl_addr (address, info, NULL, NULL); } -# ifdef SHARED -strong_alias (__dladdr, dladdr) -# endif +versioned_symbol (libc, __dladdr, dladdr, GLIBC_2_34); + +#if OTHER_SHLIB_COMPAT (libdl, GLIBC_2_0, GLIBC_2_34) +compat_symbol (libdl, __dladdr, dladdr, GLIBC_2_0); #endif diff --git a/dlfcn/sdladdr.c b/dlfcn/sdladdr.c deleted file mode 100644 index c484d63b29..0000000000 --- a/dlfcn/sdladdr.c +++ /dev/null @@ -1 +0,0 @@ -#include "dladdr.c" -- cgit 1.4.1