From 990c8ffd3a83232365f346413e394d4431875899 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 5 May 2021 17:15:57 +0200 Subject: nptl: Move sem_unlink into libc The symbol was moved using scripts/move-symbol-to-libc.py. A small adjust to the sem_unlink implementation is necessary to avoid a check-localplt failure. A placeholder symbol to keep the GLIBC_2.1.1 version alive in libpthread is added with this commit. Reviewed-by: Adhemerval Zanella --- sysdeps/pthread/sem_unlink.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'sysdeps/pthread') diff --git a/sysdeps/pthread/sem_unlink.c b/sysdeps/pthread/sem_unlink.c index 1f06a55b8e..c6f89349e5 100644 --- a/sysdeps/pthread/sem_unlink.c +++ b/sysdeps/pthread/sem_unlink.c @@ -24,8 +24,13 @@ #include "semaphoreP.h" #include +#if !PTHREAD_IN_LIBC +/* The private name is not exported from libc. */ +# define __unlink unlink +#endif + int -sem_unlink (const char *name) +__sem_unlink (const char *name) { struct shmdir_name dirname; if (__shm_get_name (&dirname, name, true) != 0) @@ -35,8 +40,16 @@ sem_unlink (const char *name) } /* Now try removing it. */ - int ret = unlink (dirname.name); + int ret = __unlink (dirname.name); if (ret < 0 && errno == EPERM) __set_errno (EACCES); return ret; } +#if PTHREAD_IN_LIBC +versioned_symbol (libc, __sem_unlink, sem_unlink, GLIBC_2_34); +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_1_1, GLIBC_2_34) +compat_symbol (libpthread, __sem_unlink, sem_unlink, GLIBC_2_1_1); +# endif +#else /* !PTHREAD_IN_LIBC */ +strong_alias (__sem_unlink, sem_unlink) +#endif -- cgit 1.4.1