aboutsummaryrefslogtreecommitdiff
path: root/dlfcn
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
commit492560a32e14c9a985274e1995b67a577197261e (patch)
treea356eea3cb1f886fdb4b39a6a64e62582ca74679 /dlfcn
parent6a1ed32789eaec6e1cd4345552e7342b5b18da5f (diff)
downloadglibc-492560a32e14c9a985274e1995b67a577197261e.zip
glibc-492560a32e14c9a985274e1995b67a577197261e.tar.gz
glibc-492560a32e14c9a985274e1995b67a577197261e.tar.bz2
dlfcn: Move dladdr1 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/Makefile3
-rw-r--r--dlfcn/Versions6
-rw-r--r--dlfcn/dladdr1.c22
-rw-r--r--dlfcn/sdladdr1.c1
4 files changed, 14 insertions, 18 deletions
diff --git a/dlfcn/Makefile b/dlfcn/Makefile
index f7ffd24..1dfa247 100644
--- a/dlfcn/Makefile
+++ b/dlfcn/Makefile
@@ -21,12 +21,13 @@ include ../Makeconfig
headers := bits/dlfcn.h dlfcn.h
extra-libs := libdl
-libdl-routines := dlopen dlvsym dladdr1 dlinfo \
+libdl-routines := dlopen dlvsym dlinfo \
dlfcn
routines := $(patsubst %,s%,$(filter-out dlfcn,$(libdl-routines)))
elide-routines.os := $(routines)
routines += \
dladdr \
+ dladdr1 \
dlclose \
dlerror \
dlmopen \
diff --git a/dlfcn/Versions b/dlfcn/Versions
index 584035e..acd9402 100644
--- a/dlfcn/Versions
+++ b/dlfcn/Versions
@@ -5,10 +5,14 @@ libc {
dlerror;
dlsym;
}
+ GLIBC_2.3.3 {
+ dladdr1;
+ }
GLIBC_2.3.4 {
dlmopen;
}
GLIBC_2.34 {
+ dladdr1;
dladdr;
dlclose;
dlerror;
@@ -29,7 +33,7 @@ libdl {
dlopen; dlvsym;
}
GLIBC_2.3.3 {
- dladdr1; dlinfo;
+ dlinfo;
}
GLIBC_2.3.4 {
__libdl_version_placeholder;
diff --git a/dlfcn/dladdr1.c b/dlfcn/dladdr1.c
index 98cd60d..203d639 100644
--- a/dlfcn/dladdr1.c
+++ b/dlfcn/dladdr1.c
@@ -18,24 +18,15 @@
#include <dlfcn.h>
#include <ldsodefs.h>
-
-#if !defined SHARED && IS_IN (libdl)
-
-int
-dladdr1 (const void *address, Dl_info *info, void **extra, int flags)
-{
- return __dladdr1 (address, info, extra, flags);
-}
-
-#else
+#include <shlib-compat.h>
int
__dladdr1 (const void *address, Dl_info *info, void **extra, int flags)
{
-# ifdef SHARED
+#ifdef SHARED
if (!rtld_active ())
return _dlfcn_hook->dladdr1 (address, info, extra, flags);
-# endif
+#endif
switch (flags)
{
@@ -48,7 +39,8 @@ __dladdr1 (const void *address, Dl_info *info, void **extra, int flags)
return _dl_addr (address, info, (struct link_map **) extra, NULL);
}
}
-# ifdef SHARED
-strong_alias (__dladdr1, dladdr1)
-# endif
+versioned_symbol (libc, __dladdr1, dladdr1, GLIBC_2_34);
+
+#if OTHER_SHLIB_COMPAT (libdl, GLIBC_2_3_3, GLIBC_2_34)
+compat_symbol (libdl, __dladdr1, dladdr1, GLIBC_2_3_3);
#endif
diff --git a/dlfcn/sdladdr1.c b/dlfcn/sdladdr1.c
deleted file mode 100644
index a655979..0000000
--- a/dlfcn/sdladdr1.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "dladdr1.c"