about summary refs log tree commit diff
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
commitd8cce17d2a8f572f26ed483246a505f45579ea0e (patch)
treeb47794d2d5ddd5e9fc0cd8cbec2c005ea0a19381 /dlfcn
parentc9ff9cf66a7ae0617a2f39e752ca19c88c58f5b6 (diff)
downloadglibc-d8cce17d2a8f572f26ed483246a505f45579ea0e.tar.gz
glibc-d8cce17d2a8f572f26ed483246a505f45579ea0e.tar.xz
glibc-d8cce17d2a8f572f26ed483246a505f45579ea0e.zip
dlfcn: Move dlclose 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/Versions3
-rw-r--r--dlfcn/dlclose.c30
-rw-r--r--dlfcn/sdlclose.c1
4 files changed, 12 insertions, 25 deletions
diff --git a/dlfcn/Makefile b/dlfcn/Makefile
index b194762d3e..4bdf524492 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 dlclose dlsym dlvsym dladdr dladdr1 dlinfo \
+libdl-routines	:= dlopen dlsym dlvsym dladdr dladdr1 dlinfo \
 		   dlmopen dlfcn
 routines	:= $(patsubst %,s%,$(filter-out dlfcn,$(libdl-routines)))
 elide-routines.os := $(routines)
 routines += \
+  dlclose \
   dlerror \
   libc_dlerror_result \
 
diff --git a/dlfcn/Versions b/dlfcn/Versions
index 76049e1c6a..d00993afa6 100644
--- a/dlfcn/Versions
+++ b/dlfcn/Versions
@@ -1,8 +1,10 @@
 libc {
   GLIBC_2.0 {
+    dlclose;
     dlerror;
   }
   GLIBC_2.34 {
+    dlclose;
     dlerror;
   }
   GLIBC_PRIVATE {
@@ -14,7 +16,6 @@ libc {
 libdl {
   GLIBC_2.0 {
     dladdr;
-    dlclose;
     dlopen;
     dlsym;
   }
diff --git a/dlfcn/dlclose.c b/dlfcn/dlclose.c
index 4bed5de55d..4d5d307ab1 100644
--- a/dlfcn/dlclose.c
+++ b/dlfcn/dlclose.c
@@ -18,34 +18,20 @@
 
 #include <dlfcn.h>
 #include <ldsodefs.h>
-
-#if !defined SHARED && IS_IN (libdl)
-
-int
-dlclose (void *handle)
-{
-  return __dlclose (handle);
-}
-
-#else
-
-static void
-dlclose_doit (void *handle)
-{
-  GLRO(dl_close) (handle);
-}
+#include <shlib-compat.h>
 
 int
 __dlclose (void *handle)
 {
-# ifdef SHARED
+#ifdef SHARED
   if (!rtld_active ())
     return _dlfcn_hook->dlclose (handle);
-# endif
+#endif
 
-  return _dlerror_run (dlclose_doit, handle) ? -1 : 0;
+  return _dlerror_run (GLRO (dl_close), handle) ? -1 : 0;
 }
-# ifdef SHARED
-strong_alias (__dlclose, dlclose)
-# endif
+versioned_symbol (libc, __dlclose, dlclose, GLIBC_2_34);
+
+#if OTHER_SHLIB_COMPAT (libdl, GLIBC_2_0, GLIBC_2_34)
+compat_symbol (libdl, __dlclose, dlclose, GLIBC_2_0);
 #endif
diff --git a/dlfcn/sdlclose.c b/dlfcn/sdlclose.c
deleted file mode 100644
index dc89b98029..0000000000
--- a/dlfcn/sdlclose.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "dlclose.c"