diff options
45 files changed, 69 insertions, 629 deletions
diff --git a/libpthread/nptl/allocatestack.c b/libpthread/nptl/allocatestack.c index 969c569a9..1e35f48aa 100644 --- a/libpthread/nptl/allocatestack.c +++ b/libpthread/nptl/allocatestack.c @@ -115,7 +115,7 @@ static LIST_HEAD (stack_used); /* List of the threads with user provided stacks in use. No need to initialize this, since it's done in __pthread_initialize_minimal. */ list_t __stack_user __attribute__ ((nocommon)); -hidden_data_def (__stack_user) +hidden_def (__stack_user) #if COLORING_INCREMENT != 0 /* Number of threads created. */ @@ -389,12 +389,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, size_t guardsize; size_t reqsize; void *mem; - const int prot = (PROT_READ | PROT_WRITE -#ifndef __UCLIBC__ - | ((GL(dl_stack_flags) & PF_X) ? PROT_EXEC : 0)); -#else - ); -#endif + const int prot = (PROT_READ | PROT_WRITE); #if COLORING_INCREMENT != 0 /* Add one more page for stack coloring. Don't do it for stacks @@ -525,30 +520,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp, lll_unlock (stack_cache_lock); - /* There might have been a race. Another thread might have - caused the stacks to get exec permission while this new - stack was prepared. Detect if this was possible and - change the permission if necessary. */ -#ifndef __UCLIBC__ - if (__builtin_expect ((GL(dl_stack_flags) & PF_X) != 0 - && (prot & PROT_EXEC) == 0, 0)) - { - int err = change_stack_perm (pd -#ifdef NEED_SEPARATE_REGISTER_STACK - , ~pagesize_m1 -#endif - ); - if (err != 0) - { - /* Free the stack memory we just allocated. */ - (void) munmap (mem, size); - - return err; - } - } -#endif - - /* Note that all of the stack and the thread descriptor is zeroed. This means we do not have to initialize fields with initial value zero. This is specifically true for @@ -678,11 +649,7 @@ internal_function __make_stacks_executable (void **stack_endp) { /* First the main thread's stack. */ -#ifndef __UCLIBC__ - int err = _dl_make_stack_executable (stack_endp); -#else int err = EPERM; -#endif if (err != 0) return err; diff --git a/libpthread/nptl/events.c b/libpthread/nptl/events.c index 8232d0c7d..df97e54f6 100644 --- a/libpthread/nptl/events.c +++ b/libpthread/nptl/events.c @@ -25,8 +25,10 @@ void __nptl_create_event (void) { } +hidden_def (__nptl_create_event) void __nptl_death_event (void) { } +hidden_def (__nptl_death_event) diff --git a/libpthread/nptl/forward.c b/libpthread/nptl/forward.c index 4958edf4a..b0ca3aee9 100644 --- a/libpthread/nptl/forward.c +++ b/libpthread/nptl/forward.c @@ -21,8 +21,6 @@ #include <pthreadP.h> #include <signal.h> #include <stdlib.h> - -#include <shlib-compat.h> #include <atomic.h> #include <sysdep.h> @@ -47,13 +45,8 @@ name decl \ FORWARD (pthread_attr_destroy, (pthread_attr_t *attr), (attr), 0) -#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_1) -FORWARD (__pthread_attr_init_2_0, (pthread_attr_t *attr), (attr), 0) -compat_symbol (libc, __pthread_attr_init_2_0, pthread_attr_init, GLIBC_2_0); -#endif - FORWARD (__pthread_attr_init_2_1, (pthread_attr_t *attr), (attr), 0) -versioned_symbol (libc, __pthread_attr_init_2_1, pthread_attr_init, GLIBC_2_1); +weak_alias(__pthread_attr_init_2_1, pthread_attr_init) FORWARD (pthread_attr_getdetachstate, (const pthread_attr_t *attr, int *detachstate), (attr, detachstate), @@ -87,72 +80,28 @@ FORWARD (pthread_attr_setscope, (pthread_attr_t *attr, int scope), FORWARD (pthread_condattr_destroy, (pthread_condattr_t *attr), (attr), 0) FORWARD (pthread_condattr_init, (pthread_condattr_t *attr), (attr), 0) -#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3_2) -FORWARD2 (__pthread_cond_broadcast_2_0, int attribute_compat_text_section, - (pthread_cond_2_0_t *cond), (cond), return 0) -compat_symbol (libc, __pthread_cond_broadcast_2_0, pthread_cond_broadcast, - GLIBC_2_0); -#endif FORWARD (__pthread_cond_broadcast, (pthread_cond_t *cond), (cond), 0) -versioned_symbol (libc, __pthread_cond_broadcast, pthread_cond_broadcast, - GLIBC_2_3_2); - -#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3_2) -FORWARD2 (__pthread_cond_destroy_2_0, int attribute_compat_text_section, - (pthread_cond_2_0_t *cond), (cond), return 0) -compat_symbol (libc, __pthread_cond_destroy_2_0, pthread_cond_destroy, - GLIBC_2_0); -#endif +weak_alias(__pthread_cond_broadcast, pthread_cond_broadcast) + FORWARD (__pthread_cond_destroy, (pthread_cond_t *cond), (cond), 0) -versioned_symbol (libc, __pthread_cond_destroy, pthread_cond_destroy, - GLIBC_2_3_2); - -#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3_2) -FORWARD2 (__pthread_cond_init_2_0, int attribute_compat_text_section, - (pthread_cond_2_0_t *cond, const pthread_condattr_t *cond_attr), - (cond, cond_attr), return 0) -compat_symbol (libc, __pthread_cond_init_2_0, pthread_cond_init, GLIBC_2_0); -#endif +weak_alias(__pthread_cond_destroy, pthread_cond_destroy) + FORWARD (__pthread_cond_init, (pthread_cond_t *cond, const pthread_condattr_t *cond_attr), (cond, cond_attr), 0) -versioned_symbol (libc, __pthread_cond_init, pthread_cond_init, GLIBC_2_3_2); - -#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3_2) -FORWARD2 (__pthread_cond_signal_2_0, int attribute_compat_text_section, - (pthread_cond_2_0_t *cond), (cond), return 0) -compat_symbol (libc, __pthread_cond_signal_2_0, pthread_cond_signal, - GLIBC_2_0); -#endif +weak_alias(__pthread_cond_init, pthread_cond_init) + FORWARD (__pthread_cond_signal, (pthread_cond_t *cond), (cond), 0) -versioned_symbol (libc, __pthread_cond_signal, pthread_cond_signal, - GLIBC_2_3_2); - -#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3_2) -FORWARD2 (__pthread_cond_wait_2_0, int attribute_compat_text_section, - (pthread_cond_2_0_t *cond, pthread_mutex_t *mutex), (cond, mutex), - return 0) -compat_symbol (libc, __pthread_cond_wait_2_0, pthread_cond_wait, - GLIBC_2_0); -#endif +weak_alias(__pthread_cond_signal, pthread_cond_signal) + FORWARD (__pthread_cond_wait, (pthread_cond_t *cond, pthread_mutex_t *mutex), (cond, mutex), 0) -versioned_symbol (libc, __pthread_cond_wait, pthread_cond_wait, - GLIBC_2_3_2); - -#if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3_2) -FORWARD2 (__pthread_cond_timedwait_2_0, int attribute_compat_text_section, - (pthread_cond_2_0_t *cond, pthread_mutex_t *mutex, - const struct timespec *abstime), (cond, mutex, abstime), - return 0) -compat_symbol (libc, __pthread_cond_timedwait_2_0, pthread_cond_timedwait, - GLIBC_2_0); -#endif +weak_alias(__pthread_cond_wait, pthread_cond_wait) + FORWARD (__pthread_cond_timedwait, (pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime), (cond, mutex, abstime), 0) -versioned_symbol (libc, __pthread_cond_timedwait, pthread_cond_timedwait, - GLIBC_2_3_2); +weak_alias(__pthread_cond_timedwait, pthread_cond_timedwait) FORWARD (pthread_equal, (pthread_t thread1, pthread_t thread2), @@ -206,8 +155,7 @@ FORWARD (pthread_setcanceltype, (int type, int *oldtype), (type, oldtype), 0) #define return /* value is void */ FORWARD2(__pthread_unwind, - void attribute_hidden __attribute ((noreturn)) __cleanup_fct_attribute - attribute_compat_text_section, + void attribute_hidden __attribute ((noreturn)) __cleanup_fct_attribute, (__pthread_unwind_buf_t *buf), (buf), { /* We cannot call abort() here. */ INTERNAL_SYSCALL_DECL (err); diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c index 6d1ead43b..a5d24672a 100644 --- a/libpthread/nptl/init.c +++ b/libpthread/nptl/init.c @@ -30,7 +30,6 @@ #include <tls.h> #include <fork.h> #include <version.h> -#include <shlib-compat.h> #include <smp.h> #include <lowlevellock.h> @@ -73,9 +72,6 @@ extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign); static const struct pthread_functions pthread_functions = { .ptr_pthread_attr_destroy = __pthread_attr_destroy, -# if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) - .ptr___pthread_attr_init_2_0 = __pthread_attr_init_2_0, -# endif .ptr___pthread_attr_init_2_1 = __pthread_attr_init_2_1, .ptr_pthread_attr_getdetachstate = __pthread_attr_getdetachstate, .ptr_pthread_attr_setdetachstate = __pthread_attr_setdetachstate, @@ -95,22 +91,14 @@ static const struct pthread_functions pthread_functions = .ptr___pthread_cond_signal = __pthread_cond_signal, .ptr___pthread_cond_wait = __pthread_cond_wait, .ptr___pthread_cond_timedwait = __pthread_cond_timedwait, -# if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_3_2) - .ptr___pthread_cond_broadcast_2_0 = __pthread_cond_broadcast_2_0, - .ptr___pthread_cond_destroy_2_0 = __pthread_cond_destroy_2_0, - .ptr___pthread_cond_init_2_0 = __pthread_cond_init_2_0, - .ptr___pthread_cond_signal_2_0 = __pthread_cond_signal_2_0, - .ptr___pthread_cond_wait_2_0 = __pthread_cond_wait_2_0, - .ptr___pthread_cond_timedwait_2_0 = __pthread_cond_timedwait_2_0, -# endif .ptr_pthread_equal = __pthread_equal, .ptr___pthread_exit = __pthread_exit, .ptr_pthread_getschedparam = __pthread_getschedparam, .ptr_pthread_setschedparam = __pthread_setschedparam, - .ptr_pthread_mutex_destroy = INTUSE(__pthread_mutex_destroy), - .ptr_pthread_mutex_init = INTUSE(__pthread_mutex_init), - .ptr_pthread_mutex_lock = INTUSE(__pthread_mutex_lock), - .ptr_pthread_mutex_unlock = INTUSE(__pthread_mutex_unlock), + .ptr_pthread_mutex_destroy = __pthread_mutex_destroy, + .ptr_pthread_mutex_init = __pthread_mutex_init, + .ptr_pthread_mutex_lock = __pthread_mutex_lock, + .ptr_pthread_mutex_unlock = __pthread_mutex_unlock, .ptr_pthread_self = __pthread_self, .ptr_pthread_setcancelstate = __pthread_setcancelstate, .ptr_pthread_setcanceltype = __pthread_setcanceltype, @@ -312,30 +300,6 @@ __pthread_initialize_minimal_internal (void) __static_tls_size = roundup (__static_tls_size, static_tls_align); -/* - * For now, we are not going to be concerend about locking inside - * the dynamic loader proper. Maybe later. We also disable stack - * execution. - */ -#ifndef __UCLIBC__ -#ifdef SHARED - /* Transfer the old value from the dynamic linker's internal location. */ - *__libc_dl_error_tsd () = *(*GL(dl_error_catch_tsd)) (); - GL(dl_error_catch_tsd) = &__libc_dl_error_tsd; - - /* Make __rtld_lock_{,un}lock_recursive use pthread_mutex_{,un}lock, - keep the lock count from the ld.so implementation. */ - GL(dl_rtld_lock_recursive) = (void *) INTUSE (__pthread_mutex_lock); - GL(dl_rtld_unlock_recursive) = (void *) INTUSE (__pthread_mutex_unlock); - unsigned int rtld_lock_count = GL(dl_load_lock).mutex.__data.__count; - GL(dl_load_lock).mutex.__data.__count = 0; - while (rtld_lock_count-- > 0) - INTUSE (__pthread_mutex_lock) (&GL(dl_load_lock).mutex); - - GL(dl_make_stack_executable_hook) = &__make_stacks_executable; -#endif -#endif - GL(dl_init_static_tls) = &__pthread_init_static_tls; /* Register the fork generation counter with the libc. */ diff --git a/libpthread/nptl/pt-cleanup.c b/libpthread/nptl/pt-cleanup.c index f9d9598e0..f5fdedeb6 100644 --- a/libpthread/nptl/pt-cleanup.c +++ b/libpthread/nptl/pt-cleanup.c @@ -60,3 +60,4 @@ __pthread_cleanup_upto (__jmp_buf target, char *targetframe) THREAD_SETMEM (self, cleanup, cbuf); } +hidden_def (__pthread_cleanup_upto) diff --git a/libpthread/nptl/pthreadP.h b/libpthread/nptl/pthreadP.h index 36ce6c696..da278bdb8 100644 --- a/libpthread/nptl/pthreadP.h +++ b/libpthread/nptl/pthreadP.h @@ -27,12 +27,7 @@ #include "descr.h" #include <tls.h> #include <lowlevellock.h> -#ifdef __UCLIBC__ -#include <libc-symbols.h> #include <bits/stackinfo.h> -#else -#include <stackinfo.h> -#endif #include <internaltypes.h> #include <pthread-functions.h> #include <atomic.h> @@ -71,7 +66,7 @@ extern int __is_smp attribute_hidden; /* Thread descriptor handling. */ extern list_t __stack_user; -hidden_proto (__stack_user) +hidden_def(__stack_user) /* Attribute handling. */ extern struct pthread_attr *__attr_list attribute_hidden; @@ -87,7 +82,7 @@ extern int __concurrency_level attribute_hidden; /* Thread-local data key handling. */ extern struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX]; -hidden_proto (__pthread_keys) +hidden_def(__pthread_keys) /* Number of threads running. */ extern unsigned int __nptl_nthreads attribute_hidden; @@ -139,10 +134,6 @@ extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf) extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) __cleanup_fct_attribute; #if defined NOT_IN_libc && defined IS_IN_libpthread -hidden_proto (__pthread_unwind) -hidden_proto (__pthread_unwind_next) -hidden_proto (__pthread_register_cancel) -hidden_proto (__pthread_unregister_cancel) # ifdef SHARED extern void attribute_hidden pthread_cancel_init (void); # endif @@ -243,7 +234,7 @@ extern int __make_stacks_executable (void **stack_endp) /* longjmp handling. */ extern void __pthread_cleanup_upto (__jmp_buf target, char *targetframe); #if defined NOT_IN_libc && defined IS_IN_libpthread -hidden_proto (__pthread_cleanup_upto) +hidden_def(__pthread_cleanup_upto) #endif @@ -261,8 +252,8 @@ extern int __pthread_attr_init_2_0 (pthread_attr_t *attr); /* Event handlers for libthread_db interface. */ extern void __nptl_create_event (void); extern void __nptl_death_event (void); -hidden_proto (__nptl_create_event) -hidden_proto (__nptl_death_event) +hidden_def(__nptl_create_event) +hidden_def(__nptl_death_event) /* Register the generation counter in the libpthread with the libc. */ #ifdef TLS_MULTIPLE_THREADS_IN_TCB diff --git a/libpthread/nptl/pthread_attr_destroy.c b/libpthread/nptl/pthread_attr_destroy.c index b8d9a20d3..cae7ca0b1 100644 --- a/libpthread/nptl/pthread_attr_destroy.c +++ b/libpthread/nptl/pthread_attr_destroy.c @@ -22,7 +22,6 @@ #include <string.h> #include <unistd.h> #include "pthreadP.h" -#include <shlib-compat.h> int __pthread_attr_destroy (attr) @@ -33,13 +32,8 @@ __pthread_attr_destroy (attr) assert (sizeof (*attr) >= sizeof (struct pthread_attr)); iattr = (struct pthread_attr *) attr; -#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) - /* In old struct pthread_attr, neither next nor cpuset are - present. */ - if (__builtin_expect ((iattr->flags & ATTR_FLAG_OLDATTR), 0) == 0) -#endif - /* The affinity CPU set might be allocated dynamically. */ - free (iattr->cpuset); + /* The affinity CPU set might be allocated dynamically. */ + free (iattr->cpuset); return 0; } diff --git a/libpthread/nptl/pthread_attr_init.c b/libpthread/nptl/pthread_attr_init.c index 9fd15c4e0..f07dfc7d9 100644 --- a/libpthread/nptl/pthread_attr_init.c +++ b/libpthread/nptl/pthread_attr_init.c @@ -23,8 +23,6 @@ #include <unistd.h> #include "pthreadP.h" -#include <shlib-compat.h> - struct pthread_attr *__attr_list; lll_lock_t __attr_list_lock = LLL_LOCK_INITIALIZER; @@ -49,40 +47,4 @@ __pthread_attr_init_2_1 (attr) return 0; } -versioned_symbol (libpthread, __pthread_attr_init_2_1, pthread_attr_init, - GLIBC_2_1); - - -#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) -int -__pthread_attr_init_2_0 (attr) - pthread_attr_t *attr; -{ - /* This code is specific to the old LinuxThread code which has a too - small pthread_attr_t definition. The struct looked like - this: */ - struct old_attr - { - int detachstate; - int schedpolicy; - struct sched_param schedparam; - int inheritsched; - int scope; - }; - struct pthread_attr *iattr; - - /* Many elements are initialized to zero so let us do it all at - once. This also takes care of clearing the bytes which are not - internally used. */ - memset (attr, '\0', sizeof (struct old_attr)); - - iattr = (struct pthread_attr *) attr; - iattr->flags |= ATTR_FLAG_OLDATTR; - - /* We cannot enqueue the attribute because that member is not in the - old attribute structure. */ - return 0; -} -compat_symbol (libpthread, __pthread_attr_init_2_0, pthread_attr_init, - GLIBC_2_0); -#endif +weak_alias(__pthread_attr_init_2_1, pthread_attr_init) diff --git a/libpthread/nptl/pthread_attr_setstack.c b/libpthread/nptl/pthread_attr_setstack.c index 622e4a225..ba8fd0e59 100644 --- a/libpthread/nptl/pthread_attr_setstack.c +++ b/libpthread/nptl/pthread_attr_setstack.c @@ -50,40 +50,7 @@ __pthread_attr_setstack (attr, stackaddr, stacksize) } #if PTHREAD_STACK_MIN == 16384 -strong_alias (__pthread_attr_setstack, pthread_attr_setstack) +strong_alias(__pthread_attr_setstack, pthread_attr_setstack) #else -# include <shlib-compat.h> -versioned_symbol (libpthread, __pthread_attr_setstack, pthread_attr_setstack, - GLIBC_2_3_3); - -# if SHLIB_COMPAT(libpthread, GLIBC_2_2, GLIBC_2_3_3) - -int -__old_pthread_attr_setstack (pthread_attr_t *attr, void *stackaddr, - size_t stacksize) -{ - struct pthread_attr *iattr; - - assert (sizeof (*attr) >= sizeof (struct pthread_attr)); - iattr = (struct pthread_attr *) attr; - - /* Catch invalid sizes. */ - if (stacksize < 16384) - return EINVAL; - -# ifdef EXTRA_PARAM_CHECKS - EXTRA_PARAM_CHECKS; -# endif - - iattr->stacksize = stacksize; - iattr->stackaddr = (char *) stackaddr + stacksize; - iattr->flags |= ATTR_FLAG_STACKADDR; - - return 0; -} - -compat_symbol (libpthread, __old_pthread_attr_setstack, pthread_attr_setstack, - GLIBC_2_2); -# endif - +weak_alias(__pthread_attr_setstack, pthread_attr_setstack) #endif diff --git a/libpthread/nptl/pthread_attr_setstacksize.c b/libpthread/nptl/pthread_attr_setstacksize.c index f84a9f68e..98339b12d 100644 --- a/libpthread/nptl/pthread_attr_setstacksize.c +++ b/libpthread/nptl/pthread_attr_setstacksize.c @@ -43,33 +43,7 @@ __pthread_attr_setstacksize (attr, stacksize) } #if PTHREAD_STACK_MIN == 16384 -strong_alias (__pthread_attr_setstacksize, pthread_attr_setstacksize) +strong_alias(__pthread_attr_setstacksize, pthread_attr_setstacksize) #else -# include <shlib-compat.h> -versioned_symbol (libpthread, __pthread_attr_setstacksize, - pthread_attr_setstacksize, GLIBC_2_3_3); - -# if SHLIB_COMPAT(libpthread, GLIBC_2_1, GLIBC_2_3_3) - -int -__old_pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize) -{ - struct pthread_attr *iattr; - - assert (sizeof (*attr) >= sizeof (struct pthread_attr)); - iattr = (struct pthread_attr *) attr; - - /* Catch invalid sizes. */ - if (stacksize < 16384) - return EINVAL; - - iattr->stacksize = stacksize; - - return 0; -} - -compat_symbol (libpthread, __old_pthread_attr_setstacksize, - pthread_attr_setstacksize, GLIBC_2_1); -# endif - +weak_alias(__pthread_attr_setstacksize, pthread_attr_setstacksize) #endif diff --git a/libpthread/nptl/pthread_cond_destroy.c b/libpthread/nptl/pthread_cond_destroy.c index 0208d18ce..b7842d258 100644 --- a/libpthread/nptl/pthread_cond_destroy.c +++ b/libpthread/nptl/pthread_cond_destroy.c @@ -18,7 +18,6 @@ 02111-1307 USA. */ #include <errno.h> -#include <shlib-compat.h> #include "pthreadP.h" @@ -57,5 +56,4 @@ __pthread_cond_destroy (cond) return 0; } -versioned_symbol (libpthread, __pthread_cond_destroy, - pthread_cond_destroy, GLIBC_2_3_2); +weak_alias(__pthread_cond_destroy, pthread_cond_destroy) diff --git a/libpthread/nptl/pthread_cond_init.c b/libpthread/nptl/pthread_cond_init.c index 5e2e6704a..5c3fd6853 100644 --- a/libpthread/nptl/pthread_cond_init.c +++ b/libpthread/nptl/pthread_cond_init.c @@ -17,7 +17,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#include <shlib-compat.h> #include "pthreadP.h" @@ -42,5 +41,4 @@ __pthread_cond_init (cond, cond_attr) return 0; } -versioned_symbol (libpthread, __pthread_cond_init, - pthread_cond_init, GLIBC_2_3_2); +weak_alias(__pthread_cond_init, pthread_cond_init) diff --git a/libpthread/nptl/pthread_create.c b/libpthread/nptl/pthread_create.c index 1dfdb7123..c544bc267 100644 --- a/libpthread/nptl/pthread_create.c +++ b/libpthread/nptl/pthread_create.c @@ -28,8 +28,6 @@ #include <libc-internal.h> #include <resolv.h> -#include <shlib-compat.h> - /* Local function to start thread and handle cleanup. */ static int start_thread (void *arg); @@ -267,11 +265,6 @@ start_thread (void *arg) /* Run the destructor for the thread-local data. */ __nptl_deallocate_tsd (); -#ifndef __UCLIBC__ - /* Clean up any state libc stored in thread-local variables. */ - __libc_thread_freeres (); -#endif - /* If this is the last thread we terminate the process now. We do not notify the debugger, it might just irritate it if there is no thread left. */ @@ -467,48 +460,7 @@ __pthread_create_2_1 (newthread, attr, start_routine, arg) return 0; } -versioned_symbol (libpthread, __pthread_create_2_1, pthread_create, GLIBC_2_1); - - -#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) -int -__pthread_create_2_0 (newthread, attr, start_routine, arg) - pthread_t *newthread; - const pthread_attr_t *attr; - void *(*start_routine) (void *); - void *arg; -{ - /* The ATTR attribute is not really of type `pthread_attr_t *'. It has - the old size and access to the new members might crash the program. - We convert the struct now. */ - struct pthread_attr new_attr; - - if (attr != NULL) - { - struct pthread_attr *iattr = (struct pthread_attr *) attr; - size_t ps = __getpagesize (); - - /* Copy values from the user-provided attributes. */ - new_attr.schedparam = iattr->schedparam; - new_attr.schedpolicy = iattr->schedpolicy; - new_attr.flags = iattr->flags; - - /* Fill in default values for the fields not present in the old - implementation. */ - new_attr.guardsize = ps; - new_attr.stackaddr = NULL; - new_attr.stacksize = 0; - new_attr.cpuset = NULL; - - /* We will pass this value on to the real implementation. */ - attr = (pthread_attr_t *) &new_attr; - } - - return __pthread_create_2_1 (newthread, attr, start_routine, arg); -} -compat_symbol (libpthread, __pthread_create_2_0, pthread_create, - GLIBC_2_0); -#endif +weak_alias(__pthread_create_2_1, pthread_create) /* Information for libthread_db. */ diff --git a/libpthread/nptl/pthread_mutex_destroy.c b/libpthread/nptl/pthread_mutex_destroy.c index 91ccfb0d2..9e63ba263 100644 --- a/libpthread/nptl/pthread_mutex_destroy.c +++ b/libpthread/nptl/pthread_mutex_destroy.c @@ -31,4 +31,3 @@ __pthread_mutex_destroy (mutex) return 0; } strong_alias (__pthread_mutex_destroy, pthread_mutex_destroy) -INTDEF(__pthread_mutex_destroy) diff --git a/libpthread/nptl/pthread_mutex_init.c b/libpthread/nptl/pthread_mutex_init.c index 074941daf..5058fcc5f 100644 --- a/libpthread/nptl/pthread_mutex_init.c +++ b/libpthread/nptl/pthread_mutex_init.c @@ -55,4 +55,3 @@ __pthread_mutex_init (mutex, mutexattr) return 0; } strong_alias (__pthread_mutex_init, pthread_mutex_init) -INTDEF(__pthread_mutex_init) diff --git a/libpthread/nptl/sem_destroy.c b/libpthread/nptl/sem_destroy.c index 1c823dc51..1fdb7b5b7 100644 --- a/libpthread/nptl/sem_destroy.c +++ b/libpthread/nptl/sem_destroy.c @@ -18,7 +18,6 @@ 02111-1307 USA. */ #include <semaphore.h> -#include <shlib-compat.h> #include "semaphoreP.h" @@ -31,8 +30,4 @@ __new_sem_destroy (sem) /* Nothing to do. */ return 0; } -versioned_symbol (libpthread, __new_sem_destroy, sem_destroy, GLIBC_2_1); -#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) -strong_alias (__new_sem_destroy, __old_sem_destroy) -compat_symbol (libpthread, __old_sem_destroy, sem_destroy, GLIBC_2_0); -#endif +weak_alias(__new_sem_destroy, sem_destroy) diff --git a/libpthread/nptl/sem_getvalue.c b/libpthread/nptl/sem_getvalue.c index 6bc7ea82b..c03827b00 100644 --- a/libpthread/nptl/sem_getvalue.c +++ b/libpthread/nptl/sem_getvalue.c @@ -18,7 +18,6 @@ 02111-1307 USA. */ #include <semaphore.h> -#include <shlib-compat.h> #include "semaphoreP.h" @@ -35,8 +34,4 @@ __new_sem_getvalue (sem, sval) return 0; } -versioned_symbol (libpthread, __new_sem_getvalue, sem_getvalue, GLIBC_2_1); -#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) -strong_alias (__new_sem_getvalue, __old_sem_getvalue) -compat_symbol (libpthread, __old_sem_getvalue, sem_getvalue, GLIBC_2_0); -#endif +weak_alias(__new_sem_getvalue, sem_getvalue) diff --git a/libpthread/nptl/sem_init.c b/libpthread/nptl/sem_init.c index 8709911ac..0fbdf594e 100644 --- a/libpthread/nptl/sem_init.c +++ b/libpthread/nptl/sem_init.c @@ -20,7 +20,6 @@ #include <errno.h> #include <semaphore.h> #include <lowlevellock.h> -#include <shlib-compat.h> #include "semaphoreP.h" @@ -48,8 +47,4 @@ __new_sem_init (sem, pshared, value) return 0; } -versioned_symbol (libpthread, __new_sem_init, sem_init, GLIBC_2_1); -#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) -strong_alias (__new_sem_init, __old_sem_init) -compat_symbol (libpthread, __old_sem_init, sem_init, GLIBC_2_0); -#endif +weak_alias(__new_sem_init, sem_init) diff --git a/libpthread/nptl/sem_open.c b/libpthread/nptl/sem_open.c index 3cdf76479..aebd4c940 100644 --- a/libpthread/nptl/sem_open.c +++ b/libpthread/nptl/sem_open.c @@ -241,7 +241,7 @@ sem_open (const char *name, int oflag, ...) int fd; /* Determine where the shmfs is mounted. */ - INTUSE(__pthread_once) (&__namedsem_once, __where_is_shmfs); + __pthread_once (&__namedsem_once, __where_is_shmfs); /* If we don't know the mount points there is nothing we can do. Ever. */ if (mountpoint.dir == NULL) diff --git a/libpthread/nptl/sem_unlink.c b/libpthread/nptl/sem_unlink.c index 7ec6663a0..5f24fd35b 100644 --- a/libpthread/nptl/sem_unlink.c +++ b/libpthread/nptl/sem_unlink.c @@ -33,7 +33,7 @@ sem_unlink (name) size_t namelen; /* Determine where the shmfs is mounted. */ - INTUSE(__pthread_once) (&__namedsem_once, __where_is_shmfs); + __pthread_once (&__namedsem_once, __where_is_shmfs); /* If we don't know the mount points there is nothing we can do. Ever. */ if (mountpoint.dir == NULL) diff --git a/libpthread/nptl/sysdeps/pthread/pthread_cond_broadcast.c b/libpthread/nptl/sysdeps/pthread/pthread_cond_broadcast.c index 1eac8ecf8..f767dcf39 100644 --- a/libpthread/nptl/sysdeps/pthread/pthread_cond_broadcast.c +++ b/libpthread/nptl/sysdeps/pthread/pthread_cond_broadcast.c @@ -23,8 +23,6 @@ #include <lowlevellock.h> #include <pthread.h> #include <pthreadP.h> - -#include <shlib-compat.h> #include <kernel-features.h> @@ -75,6 +73,4 @@ __pthread_cond_broadcast (cond) return 0; } - -versioned_symbol (libpthread, __pthread_cond_broadcast, pthread_cond_broadcast, - GLIBC_2_3_2); +weak_alias(__pthread_cond_broadcast, pthread_cond_broadcast) diff --git a/libpthread/nptl/sysdeps/pthread/pthread_cond_signal.c b/libpthread/nptl/sysdeps/pthread/pthread_cond_signal.c index f5623480f..b49131c86 100644 --- a/libpthread/nptl/sysdeps/pthread/pthread_cond_signal.c +++ b/libpthread/nptl/sysdeps/pthread/pthread_cond_signal.c @@ -23,8 +23,6 @@ #include <lowlevellock.h> #include <pthread.h> #include <pthreadP.h> - -#include <shlib-compat.h> #include <kernel-features.h> @@ -51,6 +49,4 @@ __pthread_cond_signal (cond) return 0; } - -versioned_symbol (libpthread, __pthread_cond_signal, pthread_cond_signal, - GLIBC_2_3_2); +weak_alias(__pthread_cond_signal, pthread_cond_signal) diff --git a/libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c b/libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c index fdbf43eae..db9dc4dcd 100644 --- a/libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c +++ b/libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c @@ -24,8 +24,6 @@ #include <pthread.h> #include <pthreadP.h> -#include <shlib-compat.h> - /* Cleanup handler, defined in pthread_cond_wait.c. */ extern void __condvar_cleanup (void *arg) @@ -209,6 +207,4 @@ __pthread_cond_timedwait (cond, mutex, abstime) return err ?: result; } - -versioned_symbol (libpthread, __pthread_cond_timedwait, pthread_cond_timedwait, - GLIBC_2_3_2); +weak_alias(__pthread_cond_timedwait, pthread_cond_timedwait) diff --git a/libpthread/nptl/sysdeps/pthread/pthread_cond_wait.c b/libpthread/nptl/sysdeps/pthread/pthread_cond_wait.c index 86669458a..b0fe694ba 100644 --- a/libpthread/nptl/sysdeps/pthread/pthread_cond_wait.c +++ b/libpthread/nptl/sysdeps/pthread/pthread_cond_wait.c @@ -24,8 +24,6 @@ #include <pthread.h> #include <pthreadP.h> -#include <shlib-compat.h> - struct _condvar_cleanup_buffer { @@ -180,6 +178,4 @@ __pthread_cond_wait (cond, mutex) /* Get the mutex before returning. */ return __pthread_mutex_cond_lock (mutex); } - -versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait, - GLIBC_2_3_2); +weak_alias(__pthread_cond_wait, pthread_cond_wait) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c b/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c index fd137c752..7586de8a4 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c @@ -28,6 +28,7 @@ #include <ldsodefs.h> #include <bits/stdio-lock.h> #include <atomic.h> +#include <errno.h> unsigned long int *__fork_generation_pointer; @@ -41,12 +42,11 @@ struct fork_handler *__fork_handlers; static void fresetlockfiles (void) { -#ifdef __UCLIBC__ FILE *fp; #ifdef __USE_STDIO_FUTEXES__ for (fp = _stdio_openlist; fp != NULL; fp = fp->__nextopen) _IO_lock_init(fp->_lock); -# else +#else pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); @@ -56,12 +56,6 @@ fresetlockfiles (void) pthread_mutex_init(&fp->__lock, &attr); pthread_mutexattr_destroy(&attr); -# endif -#else - _IO_ITER i; - - for (i = _IO_iter_begin(); i != _IO_iter_end(); i = _IO_iter_next(i)) - _IO_lock_init (*((_IO_lock_t *) _IO_iter_file(i)->_lock)); #endif } @@ -128,15 +122,11 @@ __libc_fork (void) break; } -#ifdef __UCLIBC__ #ifdef __USE_STDIO_FUTEXES__ _IO_lock_lock (_stdio_openlist_lock); #else __pthread_mutex_lock(&_stdio_openlist_lock); #endif -#else - _IO_list_lock (); -#endif #ifndef NDEBUG pid_t ppid = THREAD_GETMEM (THREAD_SELF, tid); @@ -180,19 +170,10 @@ __libc_fork (void) fresetlockfiles (); /* Reset locks in the I/O code. */ -#ifdef __UCLIBC__ -# ifdef __USE_STDIO_FUTEXES__ +#ifdef __USE_STDIO_FUTEXES__ _IO_lock_init (_stdio_openlist_lock); -# else - __stdio_init_mutex(&_stdio_openlist_lock); -# endif #else - _IO_list_resetlock (); -#endif - -#ifndef __UCLIBC__ - /* Reset the lock the dynamic loader uses to protect its data. */ - __rtld_lock_initialize (GL(dl_load_lock)); + __stdio_init_mutex(&_stdio_openlist_lock); #endif /* Run the handlers registered for the child. */ @@ -225,14 +206,10 @@ __libc_fork (void) THREAD_SETMEM (THREAD_SELF, pid, parentpid); /* We execute this even if the 'fork' call failed. */ -#ifdef __UCLIBC__ -# ifdef __USE_STDIO_FUTEXES__ +#ifdef __USE_STDIO_FUTEXES__ _IO_lock_unlock(_stdio_openlist_lock); -# else - __pthread_mutex_unlock(&_stdio_openlist_lock); -# endif #else - _IO_list_unlock (); + __pthread_mutex_unlock(&_stdio_openlist_lock); #endif /* Run the handlers registered for the parent. */ diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/fork.h b/libpthread/nptl/sysdeps/unix/sysv/linux/fork.h index d093ccc90..bcdf6217c 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/fork.h +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/fork.h @@ -54,4 +54,3 @@ extern int __register_atfork (void (*__prepare) (void), void (*__parent) (void), void (*__child) (void), void *dso_handle); -libc_hidden_proto (__register_atfork) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S index 71e96d222..22f23e9af 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S @@ -83,11 +83,6 @@ __new_sem_post: ret .size __new_sem_post,.-__new_sem_post versioned_symbol(libpthread, __new_sem_post, sem_post, GLIBC_2_1) -#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) - .global __old_sem_post -__old_sem_post = __new_sem_post - compat_symbol(libpthread, __old_sem_post, sem_post, GLIBC_2_0) -#endif #ifdef PIC diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S index d36a1088f..bd5ffad07 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S @@ -71,11 +71,6 @@ __new_sem_trywait: ret .size __new_sem_trywait,.-__new_sem_trywait versioned_symbol(libpthread, __new_sem_trywait, sem_trywait, GLIBC_2_1) -#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) - .global __old_sem_trywait -__old_sem_trywait = __new_sem_trywait - compat_symbol(libpthread, __old_sem_trywait, sem_trywait, GLIBC_2_0) -#endif #ifdef PIC diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S index 1605b69b6..ec274ba4e 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S @@ -132,8 +132,3 @@ __new_sem_wait: cfi_endproc .size __new_sem_wait,.-__new_sem_wait versioned_symbol(libpthread, __new_sem_wait, sem_wait, GLIBC_2_1) -#if SHLIB_COMPAT(libpthread, GLIBC_2_0, GLIBC_2_1) - .global __old_sem_wait -__old_sem_wait = __new_sem_wait - compat_symbol(libpthread, __old_sem_wait, sem_wait, GLIBC_2_0) -#endif diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c index 3c795e37e..b6d6b3d55 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/pt-longjmp.c @@ -21,35 +21,6 @@ #include <stdlib.h> #include <bits/wordsize.h> #include "pthreadP.h" -#include <shlib-compat.h> -#if defined SHARED && SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_3_4) - -/* These functions are not declared anywhere since they shouldn't be - used at another place but here. */ -extern void __novmx__libc_siglongjmp (sigjmp_buf env, int val) - __attribute__ ((noreturn)); -extern void __novmx__libc_longjmp (sigjmp_buf env, int val) - __attribute__ ((noreturn)); - - -void __novmx_siglongjmp (sigjmp_buf env, int val) -{ - __novmx__libc_siglongjmp (env, val); -} - -void __novmx_longjmp (jmp_buf env, int val) -{ - __novmx__libc_longjmp (env, val); -} - -# if __WORDSIZE == 64 -symbol_version (__novmx_longjmp,longjmp,GLIBC_2.3); -symbol_version (__novmx_siglongjmp,siglongjmp,GLIBC_2.3); -# else -symbol_version (__novmx_longjmp,longjmp,GLIBC_2.0); -symbol_version (__novmx_siglongjmp,siglongjmp,GLIBC_2.0); -# endif -#endif /* defined SHARED && SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)) */ void __vmx_longjmp (jmp_buf env, int val) @@ -62,7 +33,5 @@ __vmx_siglongjmp (jmp_buf env, int val) { __libc_siglongjmp (env, val); } - -versioned_symbol (libc, __vmx_longjmp, longjmp, GLIBC_2_3_4); -versioned_symbol (libc, __vmx_siglongjmp, siglongjmp, GLIBC_2_3_4); - +weak_alias(__vmx_longjmp, longjmp) +weak_alias(__vmx_siglongjmp, siglongjmp) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/sem_post.c b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/sem_post.c index 91b995518..06b3bd0ab 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/sem_post.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/powerpc/sem_post.c @@ -24,8 +24,6 @@ #include <internaltypes.h> #include <semaphore.h> -#include <shlib-compat.h> - int __new_sem_post (sem_t *sem) { @@ -41,8 +39,4 @@ __new_sem_post (sem_t *sem) } return 0; } -versioned_symbol (libpthread, __new_sem_post, sem_post, GLIBC_2_1); -#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1) -strong_alias (__new_sem_post, __old_sem_post) -compat_symbol (libpthread, __old_sem_post, sem_post, GLIBC_2_0); -#endif +weak_alias(__new_sem_post, sem_post) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c index 48d5a62a7..5a3d418a9 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_attr_getaffinity.c @@ -23,7 +23,6 @@ #include <string.h> #include <sysdep.h> #include <sys/types.h> -#include <shlib-compat.h> int @@ -54,17 +53,4 @@ __pthread_attr_getaffinity_new (const pthread_attr_t *attr, size_t cpusetsize, return 0; } -versioned_symbol (libpthread, __pthread_attr_getaffinity_new, - pthread_attr_getaffinity_np, GLIBC_2_3_4); - - -#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4) -int -__pthread_attr_getaffinity_old (const pthread_attr_t *attr, cpu_set_t *cpuset) -{ - /* The old interface by default assumed a 1024 processor bitmap. */ - return __pthread_attr_getaffinity_new (attr, 128, cpuset); -} -compat_symbol (libpthread, __pthread_attr_getaffinity_old, - pthread_attr_getaffinity_np, GLIBC_2_3_3); -#endif +weak_alias(__pthread_attr_getaffinity_new, pthread_attr_getaffinity_np) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c index 1842b275a..e3414999c 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c @@ -23,7 +23,6 @@ #include <stdlib.h> #include <string.h> #include <pthreadP.h> -#include <shlib-compat.h> /* Defined in pthread_setaffinity.c. */ @@ -80,17 +79,4 @@ __pthread_attr_setaffinity_new (pthread_attr_t *attr, size_t cpusetsize, return 0; } -versioned_symbol (libpthread, __pthread_attr_setaffinity_new, - pthread_attr_setaffinity_np, GLIBC_2_3_4); - - -#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4) -int -__pthread_attr_setaffinity_old (pthread_attr_t *attr, cpu_set_t *cpuset) -{ - /* The old interface by default assumed a 1024 processor bitmap. */ - return __pthread_attr_setaffinity_new (attr, 128, cpuset); -} -compat_symbol (libpthread, __pthread_attr_setaffinity_old, - pthread_attr_setaffinity_np, GLIBC_2_3_3); -#endif +weak_alias(__pthread_attr_setaffinity_new, pthread_attr_setaffinity_np) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_getaffinity.c b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_getaffinity.c index c382ed53a..ead5d42bb 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_getaffinity.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_getaffinity.c @@ -24,7 +24,6 @@ #include <sysdep.h> #include <sys/param.h> #include <sys/types.h> -#include <shlib-compat.h> int @@ -43,18 +42,5 @@ __pthread_getaffinity_new (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset) return 0; } -strong_alias (__pthread_getaffinity_new, __pthread_getaffinity_np) -versioned_symbol (libpthread, __pthread_getaffinity_new, - pthread_getaffinity_np, GLIBC_2_3_4); - - -#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4) -int -__pthread_getaffinity_old (pthread_t th, cpu_set_t *cpuset) -{ - /* The old interface by default assumed a 1024 processor bitmap. */ - return __pthread_getaffinity_new (th, 128, cpuset); -} -compat_symbol (libpthread, __pthread_getaffinity_old, pthread_getaffinity_np, - GLIBC_2_3_3); -#endif +hidden_strong_alias (__pthread_getaffinity_new, __pthread_getaffinity_np) +strong_alias (__pthread_getaffinity_new, pthread_getaffinity_np) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c index 01e21d3ce..fa7b48904 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c @@ -22,7 +22,6 @@ #include <pthreadP.h> #include <sysdep.h> #include <sys/types.h> -#include <shlib-compat.h> size_t __kernel_cpumask_size; @@ -84,17 +83,4 @@ __pthread_setaffinity_new (pthread_t th, size_t cpusetsize, ? INTERNAL_SYSCALL_ERRNO (res, err) : 0); } -versioned_symbol (libpthread, __pthread_setaffinity_new, - pthread_setaffinity_np, GLIBC_2_3_4); - - -#if SHLIB_COMPAT (libpthread, GLIBC_2_3_3, GLIBC_2_3_4) -int -__pthread_setaffinity_old (pthread_t th, cpu_set_t *cpuset) -{ - /* The old interface by default assumed a 1024 processor bitmap. */ - return __pthread_setaffinity_new (th, 128, cpuset); -} -compat_symbol (libpthread, __pthread_setaffinity_old, pthread_setaffinity_np, - GLIBC_2_3_3); -#endif +weak_alias(__pthread_setaffinity_new, pthread_setaffinity_np) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sem_post.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sem_post.c index 671b43f7f..7f0b67918 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sem_post.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sem_post.c @@ -24,8 +24,6 @@ #include <internaltypes.h> #include <semaphore.h> -#include <shlib-compat.h> - int __new_sem_post (sem_t *sem) { @@ -40,8 +38,4 @@ __new_sem_post (sem_t *sem) } return 0; } -versioned_symbol (libpthread, __new_sem_post, sem_post, GLIBC_2_1); -#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1) -strong_alias (__new_sem_post, __old_sem_post) -compat_symbol (libpthread, __old_sem_post, sem_post, GLIBC_2_0); -#endif +weak_alias(__new_sem_post, sem_post) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c index 5c8b0db7e..79b11948c 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sem_timedwait.c @@ -23,9 +23,7 @@ #include <lowlevellock.h> #include <internaltypes.h> #include <semaphore.h> - #include <pthreadP.h> -#include <shlib-compat.h> int diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sem_trywait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sem_trywait.c index f50036114..3cf1d9a8a 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sem_trywait.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sem_trywait.c @@ -24,8 +24,6 @@ #include <internaltypes.h> #include <semaphore.h> -#include <shlib-compat.h> - int __new_sem_trywait (sem_t *sem) @@ -43,8 +41,4 @@ __new_sem_trywait (sem_t *sem) __set_errno (EAGAIN); return -1; } -versioned_symbol (libpthread, __new_sem_trywait, sem_trywait, GLIBC_2_1); -#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1) -strong_alias (__new_sem_trywait, __old_sem_trywait) -compat_symbol (libpthread, __old_sem_trywait, sem_trywait, GLIBC_2_0); -#endif +weak_alias(__new_sem_trywait, sem_trywait) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sem_wait.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sem_wait.c index e6733e88a..416d8634b 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sem_wait.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/sem_wait.c @@ -23,9 +23,7 @@ #include <lowlevellock.h> #include <internaltypes.h> #include <semaphore.h> - #include <pthreadP.h> -#include <shlib-compat.h> int @@ -55,9 +53,4 @@ __new_sem_wait (sem_t *sem) __set_errno (-err); return -1; } - -versioned_symbol (libpthread, __new_sem_wait, sem_wait, GLIBC_2_1); -#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_1) -strong_alias (__new_sem_wait, __old_sem_wait) -compat_symbol (libpthread, __old_sem_wait, sem_wait, GLIBC_2_0); -#endif +weak_alias(__new_sem_wait, sem_wait) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_create.c b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_create.c index 1849f72a4..a07b1afe5 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_create.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_create.c @@ -17,7 +17,6 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <shlib-compat.h> #include "compat-timer.h" #include <atomic.h> @@ -26,41 +25,4 @@ #include "../timer_create.c" #undef timer_create -versioned_symbol (librt, __timer_create_new, timer_create, GLIBC_2_3_3); - - -#if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_3_3) -timer_t __compat_timer_list[OLD_TIMER_MAX] attribute_hidden; - - -int -__timer_create_old (clockid_t clock_id, struct sigevent *evp, int *timerid) -{ - timer_t newp; - - int res = __timer_create_new (clock_id, evp, &newp); - if (res == 0) - { - int i; - for (i = 0; i < OLD_TIMER_MAX; ++i) - if (__compat_timer_list[i] == NULL - && ! atomic_compare_and_exchange_bool_acq (&__compat_timer_list[i], - newp, NULL)) - { - *timerid = i; - break; - } - - if (__builtin_expect (i == OLD_TIMER_MAX, 0)) - { - /* No free slot. */ - (void) __timer_delete_new (newp); - __set_errno (EINVAL); - res = -1; - } - } - - return res; -} -compat_symbol (librt, __timer_create_old, timer_create, GLIBC_2_2); -#endif +weak_alias(__timer_create_new, timer_create) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_delete.c b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_delete.c index 6e0d9d033..8456dc31a 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_delete.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_delete.c @@ -17,7 +17,6 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <shlib-compat.h> #include "compat-timer.h" @@ -25,21 +24,4 @@ #include "../timer_delete.c" #undef timer_delete -versioned_symbol (librt, __timer_delete_new, timer_delete, GLIBC_2_3_3); - - -#if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_3_3) -int -__timer_delete_old (int timerid) -{ - int res = __timer_delete_new (__compat_timer_list[timerid]); - - if (res == 0) - /* Successful timer deletion, now free the index. We only need to - store a word and that better be atomic. */ - __compat_timer_list[timerid] = NULL; - - return res; -} -compat_symbol (librt, __timer_delete_old, timer_delete, GLIBC_2_2); -#endif +weak_alias(__timer_delete_new, timer_delete) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c index d75636c99..86a2df696 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_getoverr.c @@ -17,7 +17,6 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <shlib-compat.h> #include "compat-timer.h" @@ -25,15 +24,4 @@ #include "../timer_getoverr.c" #undef timer_getoverrun -versioned_symbol (librt, __timer_getoverrun_new, timer_getoverrun, - GLIBC_2_3_3); - - -#if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_3_3) -int -__timer_getoverrun_old (int timerid) -{ - return __timer_getoverrun_new (__compat_timer_list[timerid]); -} -compat_symbol (librt, __timer_getoverrun_old, timer_getoverrun, GLIBC_2_2); -#endif +weak_alias(__timer_getoverrun_new, timer_getoverrun) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c index 1f1253af2..6b260e453 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_gettime.c @@ -17,7 +17,6 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <shlib-compat.h> #include "compat-timer.h" @@ -25,14 +24,4 @@ #include "../timer_gettime.c" #undef timer_gettime -versioned_symbol (librt, __timer_gettime_new, timer_gettime, GLIBC_2_3_3); - - -#if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_3_3) -int -__timer_gettime_old (int timerid, struct itimerspec *value) -{ - return __timer_gettime_new (__compat_timer_list[timerid], value); -} -compat_symbol (librt, __timer_gettime_old, timer_gettime, GLIBC_2_2); -#endif +weak_alias(__timer_gettime_new, timer_gettime) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_settime.c b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_settime.c index 4c945ec51..0ec178246 100644 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_settime.c +++ b/libpthread/nptl/sysdeps/unix/sysv/linux/x86_64/timer_settime.c @@ -17,7 +17,6 @@ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <shlib-compat.h> #include "compat-timer.h" @@ -25,16 +24,4 @@ #include "../timer_settime.c" #undef timer_settime -versioned_symbol (librt, __timer_settime_new, timer_settime, GLIBC_2_3_3); - - -#if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_3_3) -int -__timer_settime_old (int timerid, int flags, const struct itimerspec *value, - struct itimerspec *ovalue) -{ - return __timer_settime_new (__compat_timer_list[timerid], flags, - value, ovalue); -} -compat_symbol (librt, __timer_settime_old, timer_settime, GLIBC_2_2); -#endif +weak_alias(__timer_settime_new, timer_settime) diff --git a/libpthread/nptl/vars.c b/libpthread/nptl/vars.c index 1e1a3cf5b..c4306737f 100644 --- a/libpthread/nptl/vars.c +++ b/libpthread/nptl/vars.c @@ -40,4 +40,4 @@ int __pthread_multiple_threads attribute_hidden; /* Table of the key information. */ struct pthread_key_struct __pthread_keys[PTHREAD_KEYS_MAX] __attribute__ ((nocommon)); -hidden_data_def (__pthread_keys) +hidden_def (__pthread_keys) |