From b855e52bae0f754150fbad78c76d363b6eb2e53c Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 11 May 2021 19:32:43 +0200 Subject: nptl: Move pthread_attr_setstack into libc The symbol was moved using scripts/move-symbol-to-libc.py. Reviewed-by: Adhemerval Zanella --- nptl/Makefile | 2 +- nptl/Versions | 3 ++- nptl/pthread_attr_setstack.c | 31 ++++++++++++++++++------------- 3 files changed, 21 insertions(+), 15 deletions(-) (limited to 'nptl') diff --git a/nptl/Makefile b/nptl/Makefile index 9bd601ae57..a4f1e91649 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -82,6 +82,7 @@ routines = \ pthread_attr_setscope \ pthread_attr_setsigmask \ pthread_attr_setsigmask_internal \ + pthread_attr_setstack \ pthread_barrier_destroy \ pthread_barrier_init \ pthread_barrier_wait \ @@ -198,7 +199,6 @@ libpthread-routines = \ libpthread-compat \ nptl-init \ pt-interp \ - pthread_attr_setstack \ pthread_attr_setstackaddr \ pthread_attr_setstacksize \ pthread_cancel \ diff --git a/nptl/Versions b/nptl/Versions index c7e8cb579e..b96fadf49f 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -113,6 +113,7 @@ libc { __pthread_rwlock_unlock; __pthread_rwlock_wrlock; pthread_attr_getstack; + pthread_attr_setstack; pthread_barrier_destroy; pthread_barrier_init; pthread_barrier_wait; @@ -250,6 +251,7 @@ libc { pthread_attr_getstackaddr; pthread_attr_getstacksize; pthread_attr_setguardsize; + pthread_attr_setstack; pthread_barrier_destroy; pthread_barrier_init; pthread_barrier_wait; @@ -414,7 +416,6 @@ libpthread { } GLIBC_2.2 { - pthread_attr_setstack; pthread_getcpuclockid; pthread_yield; pthread_rwlock_timedrdlock; diff --git a/nptl/pthread_attr_setstack.c b/nptl/pthread_attr_setstack.c index 357f633f0e..41d6b4d789 100644 --- a/nptl/pthread_attr_setstack.c +++ b/nptl/pthread_attr_setstack.c @@ -19,6 +19,7 @@ #include #include #include "pthreadP.h" +#include #ifndef NEW_VERNUM @@ -53,16 +54,21 @@ __pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, return 0; } +versioned_symbol (libc, __pthread_attr_setstack, pthread_attr_setstack, + GLIBC_2_34); #if PTHREAD_STACK_MIN == 16384 -strong_alias (__pthread_attr_setstack, pthread_attr_setstack) -#else -# include -versioned_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack, - NEW_VERNUM); - -# if SHLIB_COMPAT(libpthread, GLIBC_2_2, NEW_VERNUM) +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, GLIBC_2_34) +compat_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack, + GLIBC_2_2); +# endif +#else /* PTHREAD_STACK_MIN != 16384 */ +# if OTHER_SHLIB_COMPAT (libpthread, NEW_VERNUM, GLIBC_2_34) +compat_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack, + NEW_VERNUM); +# endif +# if OTHER_SHLIB_COMPAT (libpthread, GLIBC_2_2, NEW_VERNUM) int __old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, size_t stacksize) @@ -80,11 +86,11 @@ __old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, # endif iattr->stacksize = stacksize; -#if _STACK_GROWS_DOWN +# if _STACK_GROWS_DOWN iattr->stackaddr = (char *) stackaddr + stacksize; -#else +# else iattr->stackaddr = (char *) stackaddr; -#endif +# endif iattr->flags |= ATTR_FLAG_STACKADDR; return 0; @@ -92,6 +98,5 @@ __old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, compat_symbol (libpthread, __old_pthread_attr_setstack, pthread_attr_setstack, GLIBC_2_2); -# endif - -#endif +# endif /* OTHER_SHLIB_COMPAT */ +#endif /* PTHREAD_STACK_MIN != 16384 */ -- cgit 1.4.1