summary refs log tree commit diff
path: root/nptl/cleanup_defer_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_defer_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_defer_compat.c')
-rw-r--r--nptl/cleanup_defer_compat.c20
1 files changed, 13 insertions, 7 deletions
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
    <https://www.gnu.org/licenses/>.  */
 
-#include "pthreadP.h"
-#include <libc-lock.h>
+#include <shlib-compat.h>
 
-void
+#if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_34)
+# include "pthreadP.h"
+# include <libc-lock.h>
+
+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 */