From 1f2e5bfe48ae7a0a74896d7f3019d976c1647e56 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 21 Apr 2021 19:49:50 +0200 Subject: 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 --- nptl/cleanup_defer_compat.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'nptl/cleanup_defer_compat.c') diff --git a/nptl/cleanup_defer_compat.c b/nptl/cleanup_defer_compat.c index 1957318208..238eb46ee4 100644 --- a/nptl/cleanup_defer_compat.c +++ b/nptl/cleanup_defer_compat.c @@ -16,10 +16,13 @@ License along with the GNU C Library; if not, see . */ -#include "pthreadP.h" -#include +#include -void +#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34) +# include "pthreadP.h" +# include + +void attribute_compat_text_section _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer, void (*routine) (void *), void *arg) { @@ -27,10 +30,10 @@ _pthread_cleanup_push_defer (struct _pthread_cleanup_buffer *buffer, buffer->__arg = arg; __libc_cleanup_push_defer (buffer); } -strong_alias (_pthread_cleanup_push_defer, __pthread_cleanup_push_defer) - +compat_symbol (libpthread, _pthread_cleanup_push_defer, + _pthread_cleanup_push_defer, GLIBC_2_0); -void +void attribute_compat_text_section _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer, int execute) { @@ -41,4 +44,7 @@ _pthread_cleanup_pop_restore (struct _pthread_cleanup_buffer *buffer, if (execute) buffer->__routine (buffer->__arg); } -strong_alias (_pthread_cleanup_pop_restore, __pthread_cleanup_pop_restore) +compat_symbol (libpthread, _pthread_cleanup_pop_restore, + _pthread_cleanup_pop_restore, GLIBC_2_0); + +#endif /* OTHER_SHLIB_COMPAT */ -- cgit 1.4.1