about summary refs log tree commit diff
path: root/nptl/cleanup_compat.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2021-04-21 19:49:50 +0200
committerFlorian Weimer <fweimer@redhat.com>2021-04-21 19:49:50 +0200
commit1f2e5bfe48ae7a0a74896d7f3019d976c1647e56 (patch)
tree103c889d6d7a47e9e3be01325aaaa5d532ed75a6 /nptl/cleanup_compat.c
parentf79f2065817e080f65f3c3a2fee966f5a97f1746 (diff)
downloadglibc-1f2e5bfe48ae7a0a74896d7f3019d976c1647e56.tar.gz
glibc-1f2e5bfe48ae7a0a74896d7f3019d976c1647e56.tar.xz
glibc-1f2e5bfe48ae7a0a74896d7f3019d976c1647e56.zip
nptl: Move legacy cancelation handling into libc as compat symbols
This affects _pthread_cleanup_pop, _pthread_cleanup_pop_restore,
_pthread_cleanup_push, _pthread_cleanup_push_defer.  The symbols
have been moved using scripts/move-symbol-to-libc.py.

No new symbol versions are added because the symbols are turned into
compatibility symbols at the same time.

__pthread_cleanup_pop and __pthread_cleanup_push are added as
GLIBC_PRIVATE symbols because they are also used internally, for
glibc's own cancellation handling.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
Diffstat (limited to 'nptl/cleanup_compat.c')
-rw-r--r--nptl/cleanup_compat.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/nptl/cleanup_compat.c b/nptl/cleanup_compat.c
index fec88c2f86..1a757cf06a 100644
--- a/nptl/cleanup_compat.c
+++ b/nptl/cleanup_compat.c
@@ -16,12 +16,12 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
+#include <shlib-compat.h>
 #include <stdlib.h>
 #include "pthreadP.h"
 
-
 void
-_pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer,
+__pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer,
 		       void (*routine) (void *), void *arg)
 {
   struct pthread *self = THREAD_SELF;
@@ -32,11 +32,10 @@ _pthread_cleanup_push (struct _pthread_cleanup_buffer *buffer,
 
   THREAD_SETMEM (self, cleanup, buffer);
 }
-strong_alias (_pthread_cleanup_push, __pthread_cleanup_push)
-
+libc_hidden_def (__pthread_cleanup_push)
 
 void
-_pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer, int execute)
+__pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer, int execute)
 {
   struct pthread *self __attribute ((unused)) = THREAD_SELF;
 
@@ -47,4 +46,11 @@ _pthread_cleanup_pop (struct _pthread_cleanup_buffer *buffer, int execute)
   if (execute)
     buffer->__routine (buffer->__arg);
 }
-strong_alias (_pthread_cleanup_pop, __pthread_cleanup_pop)
+libc_hidden_def (__pthread_cleanup_pop)
+
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34)
+compat_symbol (libpthread, __pthread_cleanup_push, _pthread_cleanup_push,
+	       GLIBC_2_0);
+compat_symbol (libpthread, __pthread_cleanup_pop, _pthread_cleanup_pop,
+	       GLIBC_2_0);
+#endif