about summary refs log tree commit diff
path: root/dlfcn/dlclose.c
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/dlclose.c
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/dlclose.c')
-rw-r--r--dlfcn/dlclose.c30
1 files changed, 8 insertions, 22 deletions
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