diff options
| author | Florian Weimer <fweimer@redhat.com> | 2021-06-03 08:26:04 +0200 |
|---|---|---|
| committer | Florian Weimer <fweimer@redhat.com> | 2021-06-03 08:26:04 +0200 |
| commit | d8cce17d2a8f572f26ed483246a505f45579ea0e (patch) | |
| tree | b47794d2d5ddd5e9fc0cd8cbec2c005ea0a19381 | |
| parent | c9ff9cf66a7ae0617a2f39e752ca19c88c58f5b6 (diff) | |
| download | 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>
68 files changed, 83 insertions, 57 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" diff --git a/include/dlfcn.h b/include/dlfcn.h index a92b2aefb8..352eb79500 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -126,12 +126,15 @@ struct dlfcn_hook extern struct dlfcn_hook *_dlfcn_hook; libc_hidden_proto (_dlfcn_hook) +/* Note: These prototypes are for initializing _dflcn_hook in static + libraries. Internal calls in glibc should use the __libc_dl* + functions defined in elf/dl-libc.c instead. */ + extern void *__dlopen (const char *file, int mode DL_CALLER_DECL) attribute_hidden; extern void *__dlmopen (Lmid_t nsid, const char *file, int mode DL_CALLER_DECL) attribute_hidden; -extern int __dlclose (void *handle) - attribute_hidden; +extern int __dlclose (void *handle); extern void *__dlsym (void *handle, const char *name DL_CALLER_DECL) attribute_hidden; extern void *__dlvsym (void *handle, const char *name, const char *version diff --git a/sysdeps/mach/hurd/i386/libc.abilist b/sysdeps/mach/hurd/i386/libc.abilist index 4c62bf215f..7e1b9845fc 100644 --- a/sysdeps/mach/hurd/i386/libc.abilist +++ b/sysdeps/mach/hurd/i386/libc.abilist @@ -741,6 +741,7 @@ GLIBC_2.2.6 dirfd F GLIBC_2.2.6 dirname F GLIBC_2.2.6 div F GLIBC_2.2.6 dl_iterate_phdr F +GLIBC_2.2.6 dlclose F GLIBC_2.2.6 dlerror F GLIBC_2.2.6 dngettext F GLIBC_2.2.6 dprintf F @@ -2208,6 +2209,7 @@ GLIBC_2.33 stat64 F GLIBC_2.34 __isnanf128 F GLIBC_2.34 __libc_start_main F GLIBC_2.34 _hurd_libc_proc_init F +GLIBC_2.34 dlclose F GLIBC_2.34 dlerror F GLIBC_2.34 execveat F GLIBC_2.34 timespec_getres F diff --git a/sysdeps/mach/hurd/i386/libdl.abilist b/sysdeps/mach/hurd/i386/libdl.abilist index 1073ce7845..d267e7d457 100644 --- a/sysdeps/mach/hurd/i386/libdl.abilist +++ b/sysdeps/mach/hurd/i386/libdl.abilist @@ -1,5 +1,4 @@ GLIBC_2.2.6 dladdr F -GLIBC_2.2.6 dlclose F GLIBC_2.2.6 dlopen F GLIBC_2.2.6 dlsym F GLIBC_2.2.6 dlvsym F diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index cf1e160614..8fdbe6548e 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -718,6 +718,7 @@ GLIBC_2.17 dirfd F GLIBC_2.17 dirname F GLIBC_2.17 div F GLIBC_2.17 dl_iterate_phdr F +GLIBC_2.17 dlclose F GLIBC_2.17 dlerror F GLIBC_2.17 dngettext F GLIBC_2.17 dprintf F @@ -2343,6 +2344,7 @@ GLIBC_2.34 cnd_init F GLIBC_2.34 cnd_signal F GLIBC_2.34 cnd_timedwait F GLIBC_2.34 cnd_wait F +GLIBC_2.34 dlclose F GLIBC_2.34 dlerror F GL |
