[PATCH] linuxthreads: Use hidden definitions when building __pthread_functions.

Will Newton will.newton at gmail.com
Wed Jan 27 17:25:54 UTC 2010


Use hidden definitions of pthread internal functions when building the
__pthread_functions array of function pointers. This prevents these
symbols being overridden by definitions in the C library.

Signed-off-by: Will Newton <will.newton at gmail.com>
---
 libpthread/linuxthreads/Makefile.in |    6 +++
 libpthread/linuxthreads/attr.c      |   24 ++++++++++++++
 libpthread/linuxthreads/cancel.c    |   13 +++++++
 libpthread/linuxthreads/condvar.c   |   17 ++++++++++
 libpthread/linuxthreads/join.c      |    5 +++
 libpthread/linuxthreads/mutex.c     |   11 ++++++
 libpthread/linuxthreads/ptcleanup.c |    3 ++
 libpthread/linuxthreads/ptfork.c    |    3 ++
 libpthread/linuxthreads/pthread.c   |   61 +++++++++++++++++++++++++++++++++++
 libpthread/linuxthreads/signals.c   |    7 ++++
 10 files changed, 150 insertions(+), 0 deletions(-)

diff --git a/libpthread/linuxthreads/Makefile.in
b/libpthread/linuxthreads/Makefile.in
index 7ed3ec5..c5ae8e9 100644
--- a/libpthread/linuxthreads/Makefile.in
+++ b/libpthread/linuxthreads/Makefile.in
@@ -17,6 +17,12 @@
CFLAGS-libpthread/linuxthreads/sysdeps/$(TARGET_ARCH)/ :=
$(CFLAGS-linuxthreads)
 CFLAGS-libpthread/linuxthreads/sysdeps/unix/sysv/linux/ :=
$(CFLAGS-linuxthreads)
 CFLAGS-libpthread/linuxthreads/sysdeps/pthread/         :=
$(CFLAGS-linuxthreads)

+CFLAGS-mutex.c += -D__NO_WEAK_PTHREAD_ALIASES
+CFLAGS-specific.c += -D__NO_WEAK_PTHREAD_ALIASES
+CFLAGS-pthread.c += -D__NO_WEAK_PTHREAD_ALIASES
+CFLAGS-ptfork.c += -D__NO_WEAK_PTHREAD_ALIASES
+CFLAGS-cancel.c += -D__NO_WEAK_PTHREAD_ALIASES
+
 # This stuff will not compile without at least -O1
 # psm: can't handle this here, could maybe search for -O0 in CFLAGS
 # and append -O1 if found
diff --git a/libpthread/linuxthreads/attr.c b/libpthread/linuxthreads/attr.c
index 52e115c..1a93bcb 100644
--- a/libpthread/linuxthreads/attr.c
+++ b/libpthread/linuxthreads/attr.c
@@ -26,6 +26,18 @@
 #include "pthread.h"
 #include "internals.h"

+libpthread_hidden_proto(__pthread_attr_destroy)
+libpthread_hidden_proto(__pthread_attr_init)
+libpthread_hidden_proto(__pthread_attr_getdetachstate)
+libpthread_hidden_proto(__pthread_attr_setdetachstate)
+libpthread_hidden_proto(__pthread_attr_getinheritsched)
+libpthread_hidden_proto(__pthread_attr_setinheritsched)
+libpthread_hidden_proto(__pthread_attr_getschedparam)
+libpthread_hidden_proto(__pthread_attr_setschedparam)
+libpthread_hidden_proto(__pthread_attr_getschedpolicy)
+libpthread_hidden_proto(__pthread_attr_setschedpolicy)
+libpthread_hidden_proto(__pthread_attr_getscope)
+libpthread_hidden_proto(__pthread_attr_setscope)

 int __pthread_attr_init(pthread_attr_t *attr)
 {
@@ -46,12 +58,14 @@ int __pthread_attr_init(pthread_attr_t *attr)
   attr->__stacksize = STACK_SIZE - ps;
   return 0;
 }
+libpthread_hidden_def(__pthread_attr_init)
 strong_alias (__pthread_attr_init, pthread_attr_init)

 int __pthread_attr_destroy(pthread_attr_t *attr)
 {
   return 0;
 }
+libpthread_hidden_def(__pthread_attr_destroy)
 strong_alias (__pthread_attr_destroy, pthread_attr_destroy)

 int __pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate)
@@ -62,6 +76,7 @@ int __pthread_attr_setdetachstate(pthread_attr_t
*attr, int detachstate)
   attr->__detachstate = detachstate;
   return 0;
 }
+libpthread_hidden_def(__pthread_attr_setdetachstate)
 strong_alias (__pthread_attr_setdetachstate, pthread_attr_setdetachstate)

 int __pthread_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate)
@@ -69,6 +84,7 @@ int __pthread_attr_getdetachstate(const
pthread_attr_t *attr, int *detachstate)
   *detachstate = attr->__detachstate;
   return 0;
 }
+libpthread_hidden_def(__pthread_attr_getdetachstate)
 strong_alias (__pthread_attr_getdetachstate, pthread_attr_getdetachstate)

 int __pthread_attr_setschedparam(pthread_attr_t *attr,
@@ -82,6 +98,7 @@ int __pthread_attr_setschedparam(pthread_attr_t *attr,
   memcpy (&attr->__schedparam, param, sizeof (struct sched_param));
   return 0;
 }
+libpthread_hidden_def(__pthread_attr_setschedparam)
 strong_alias (__pthread_attr_setschedparam, pthread_attr_setschedparam)

 int __pthread_attr_getschedparam(const pthread_attr_t *attr,
@@ -90,6 +107,7 @@ int __pthread_attr_getschedparam(const pthread_attr_t *attr,
   memcpy (param, &attr->__schedparam, sizeof (struct sched_param));
   return 0;
 }
+libpthread_hidden_def(__pthread_attr_getschedparam)
 strong_alias (__pthread_attr_getschedparam, pthread_attr_getschedparam)

 int __pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy)
@@ -99,6 +117,7 @@ int __pthread_attr_setschedpolicy(pthread_attr_t
*attr, int policy)
   attr->__schedpolicy = policy;
   return 0;
 }
+libpthread_hidden_def(__pthread_attr_setschedpolicy)
 strong_alias (__pthread_attr_setschedpolicy, pthread_attr_setschedpolicy)

 int __pthread_attr_getschedpolicy(const pthread_attr_t *attr, int *policy)
@@ -106,6 +125,7 @@ int __pthread_attr_getschedpolicy(const
pthread_attr_t *attr, int *policy)
   *policy = attr->__schedpolicy;
   return 0;
 }
+libpthread_hidden_def(__pthread_attr_getschedpolicy)
 strong_alias (__pthread_attr_getschedpolicy, pthread_attr_getschedpolicy)

 int __pthread_attr_setinheritsched(pthread_attr_t *attr, int inherit)
@@ -115,6 +135,7 @@ int __pthread_attr_setinheritsched(pthread_attr_t
*attr, int inherit)
   attr->__inheritsched = inherit;
   return 0;
 }
+libpthread_hidden_def(__pthread_attr_setinheritsched)
 strong_alias (__pthread_attr_setinheritsched, pthread_attr_setinheritsched)

 int __pthread_attr_getinheritsched(const pthread_attr_t *attr, int *inherit)
@@ -122,6 +143,7 @@ int __pthread_attr_getinheritsched(const
pthread_attr_t *attr, int *inherit)
   *inherit = attr->__inheritsched;
   return 0;
 }
+libpthread_hidden_def(__pthread_attr_getinheritsched)
 strong_alias (__pthread_attr_getinheritsched, pthread_attr_getinheritsched)

 int __pthread_attr_setscope(pthread_attr_t *attr, int scope)
@@ -136,6 +158,7 @@ int __pthread_attr_setscope(pthread_attr_t *attr, int scope)
     return EINVAL;
   }
 }
+libpthread_hidden_def(__pthread_attr_setscope)
 strong_alias (__pthread_attr_setscope, pthread_attr_setscope)

 int __pthread_attr_getscope(const pthread_attr_t *attr, int *scope)
@@ -143,6 +166,7 @@ int __pthread_attr_getscope(const pthread_attr_t
*attr, int *scope)
   *scope = attr->__scope;
   return 0;
 }
+libpthread_hidden_def(__pthread_attr_getscope)
 strong_alias (__pthread_attr_getscope, pthread_attr_getscope)

 int __pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize)
diff --git a/libpthread/linuxthreads/cancel.c b/libpthread/linuxthreads/cancel.c
index 3435680..22c2d3b 100644
--- a/libpthread/linuxthreads/cancel.c
+++ b/libpthread/linuxthreads/cancel.c
@@ -29,6 +29,13 @@
 # error "Define either _STACK_GROWS_DOWN or _STACK_GROWS_UP"
 #endif

+libpthread_hidden_proto(__pthread_setcancelstate)
+libpthread_hidden_proto(__pthread_setcanceltype)
+
+libpthread_hidden_proto(_pthread_cleanup_push)
+libpthread_hidden_proto(_pthread_cleanup_push_defer)
+libpthread_hidden_proto(_pthread_cleanup_pop)
+libpthread_hidden_proto(_pthread_cleanup_pop_restore)

 int __pthread_setcancelstate(int state, int * oldstate)
 {
@@ -43,6 +50,7 @@ int __pthread_setcancelstate(int state, int * oldstate)
     __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME);
   return 0;
 }
+libpthread_hidden_def(__pthread_setcancelstate)
 strong_alias (__pthread_setcancelstate, pthread_setcancelstate)

 int __pthread_setcanceltype(int type, int * oldtype)
@@ -58,6 +66,7 @@ int __pthread_setcanceltype(int type, int * oldtype)
     __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME);
   return 0;
 }
+libpthread_hidden_def(__pthread_setcanceltype)
 strong_alias (__pthread_setcanceltype, pthread_setcanceltype)


@@ -163,6 +172,7 @@ void _pthread_cleanup_push(struct
_pthread_cleanup_buffer * buffer,
     buffer->__prev = NULL;
   THREAD_SETMEM(self, p_cleanup, buffer);
 }
+libpthread_hidden_def(_pthread_cleanup_push)

 void _pthread_cleanup_pop(struct _pthread_cleanup_buffer * buffer,
 			  int execute)
@@ -171,6 +181,7 @@ void _pthread_cleanup_pop(struct
_pthread_cleanup_buffer * buffer,
   if (execute) buffer->__routine(buffer->__arg);
   THREAD_SETMEM(self, p_cleanup, buffer->__prev);
 }
+libpthread_hidden_def(_pthread_cleanup_pop)

 void _pthread_cleanup_push_defer(struct _pthread_cleanup_buffer * buffer,
 				 void (*routine)(void *), void * arg)
@@ -185,6 +196,7 @@ void _pthread_cleanup_push_defer(struct
_pthread_cleanup_buffer * buffer,
   THREAD_SETMEM(self, p_canceltype, PTHREAD_CANCEL_DEFERRED);
   THREAD_SETMEM(self, p_cleanup, buffer);
 }
+libpthread_hidden_def(_pthread_cleanup_push_defer)

 void _pthread_cleanup_pop_restore(struct _pthread_cleanup_buffer * buffer,
 				  int execute)
@@ -198,6 +210,7 @@ void _pthread_cleanup_pop_restore(struct
_pthread_cleanup_buffer * buffer,
       THREAD_GETMEM(self, p_canceltype) == PTHREAD_CANCEL_ASYNCHRONOUS)
     __pthread_do_exit(PTHREAD_CANCELED, CURRENT_STACK_FRAME);
 }
+libpthread_hidden_def(_pthread_cleanup_pop_restore)

 extern void __rpc_thread_destroy(void);
 void __pthread_perform_cleanup(char *currentframe)
diff --git a/libpthread/linuxthreads/condvar.c
b/libpthread/linuxthreads/condvar.c
index d7b2e98..1483a72 100644
--- a/libpthread/linuxthreads/condvar.c
+++ b/libpthread/linuxthreads/condvar.c
@@ -25,6 +25,15 @@
 #include "queue.h"
 #include "restart.h"

+libpthread_hidden_proto(__pthread_condattr_destroy)
+libpthread_hidden_proto(__pthread_condattr_init)
+libpthread_hidden_proto(__pthread_cond_broadcast)
+libpthread_hidden_proto(__pthread_cond_destroy)
+libpthread_hidden_proto(__pthread_cond_init)
+libpthread_hidden_proto(__pthread_cond_signal)
+libpthread_hidden_proto(__pthread_cond_wait)
+libpthread_hidden_proto(__pthread_cond_timedwait)
+
 int __pthread_cond_init(pthread_cond_t *cond,
                         const pthread_condattr_t *cond_attr)
 {
@@ -32,6 +41,7 @@ int __pthread_cond_init(pthread_cond_t *cond,
   cond->__c_waiting = NULL;
   return 0;
 }
+libpthread_hidden_def(__pthread_cond_init)
 strong_alias (__pthread_cond_init, pthread_cond_init)

 int __pthread_cond_destroy(pthread_cond_t *cond)
@@ -39,6 +49,7 @@ int __pthread_cond_destroy(pthread_cond_t *cond)
   if (cond->__c_waiting != NULL) return EBUSY;
   return 0;
 }
+libpthread_hidden_def(__pthread_cond_destroy)
 strong_alias (__pthread_cond_destroy, pthread_cond_destroy)

 /* Function called by pthread_cancel to remove the thread from
@@ -134,6 +145,7 @@ int __pthread_cond_wait(pthread_cond_t *cond,
pthread_mutex_t *mutex)
   pthread_mutex_lock(mutex);
   return 0;
 }
+libpthread_hidden_def(__pthread_cond_wait)
 strong_alias (__pthread_cond_wait, pthread_cond_wait)

 static int
@@ -236,6 +248,7 @@ int __pthread_cond_timedwait(pthread_cond_t *cond,
pthread_mutex_t *mutex,
   /* Indirect call through pointer! */
   return pthread_cond_timedwait_relative(cond, mutex, abstime);
 }
+libpthread_hidden_def(__pthread_cond_timedwait)
 strong_alias (__pthread_cond_timedwait, pthread_cond_timedwait)

 int __pthread_cond_signal(pthread_cond_t *cond)
@@ -252,6 +265,7 @@ int __pthread_cond_signal(pthread_cond_t *cond)
   }
   return 0;
 }
+libpthread_hidden_def(__pthread_cond_signal)
 strong_alias (__pthread_cond_signal, pthread_cond_signal)

 int __pthread_cond_broadcast(pthread_cond_t *cond)
@@ -271,18 +285,21 @@ int __pthread_cond_broadcast(pthread_cond_t *cond)
   }
   return 0;
 }
+libpthread_hidden_def(__pthread_cond_broadcast)
 strong_alias (__pthread_cond_broadcast, pthread_cond_broadcast)

 int __pthread_condattr_init(pthread_condattr_t *attr)
 {
   return 0;
 }
+libpthread_hidden_def(__pthread_condattr_init)
 strong_alias (__pthread_condattr_init, pthread_condattr_init)

 int __pthread_condattr_destroy(pthread_condattr_t *attr)
 {
   return 0;
 }
+libpthread_hidden_def(__pthread_condattr_destroy)
 strong_alias (__pthread_condattr_destroy, pthread_condattr_destroy)

 int pthread_condattr_getpshared (const pthread_condattr_t *attr, int *pshared)
diff --git a/libpthread/linuxthreads/join.c b/libpthread/linuxthreads/join.c
index 57ea54e..34e9c50 100644
--- a/libpthread/linuxthreads/join.c
+++ b/libpthread/linuxthreads/join.c
@@ -24,10 +24,14 @@
 #include "restart.h"
 #include <not-cancel.h>

+libpthread_hidden_proto(__pthread_exit)
+libpthread_hidden_proto(__pthread_do_exit)
+
 void __pthread_exit(void * retval)
 {
   __pthread_do_exit (retval, CURRENT_STACK_FRAME);
 }
+libpthread_hidden_def(__pthread_exit)
 strong_alias (__pthread_exit, pthread_exit)

 void __pthread_do_exit(void *retval, char *currentframe)
@@ -91,6 +95,7 @@ void __pthread_do_exit(void *retval, char *currentframe)
      or running atexit functions. */
   _exit(0);
 }
+libpthread_hidden_def(__pthread_do_exit)

 /* Function called by pthread_cancel to remove the thread from
    waiting on a condition variable queue. */
diff --git a/libpthread/linuxthreads/mutex.c b/libpthread/linuxthreads/mutex.c
index 3c97ea7..af9c0eb 100644
--- a/libpthread/linuxthreads/mutex.c
+++ b/libpthread/linuxthreads/mutex.c
@@ -25,6 +25,12 @@
 #include "queue.h"
 #include "restart.h"

+libpthread_hidden_proto(__pthread_mutex_destroy)
+libpthread_hidden_proto(__pthread_mutex_init)
+libpthread_hidden_proto(__pthread_mutex_lock)
+libpthread_hidden_proto(__pthread_mutex_trylock)
+libpthread_hidden_proto(__pthread_mutex_unlock)
+
 int __pthread_mutex_init(pthread_mutex_t * mutex,
                        const pthread_mutexattr_t * mutex_attr)
 {
@@ -35,6 +41,7 @@ int __pthread_mutex_init(pthread_mutex_t * mutex,
   mutex->__m_owner = NULL;
   return 0;
 }
+libpthread_hidden_def(__pthread_mutex_init)
 strong_alias (__pthread_mutex_init, pthread_mutex_init)

 int __pthread_mutex_destroy(pthread_mutex_t * mutex)
@@ -54,6 +61,7 @@ int __pthread_mutex_destroy(pthread_mutex_t * mutex)
     return EINVAL;
   }
 }
+libpthread_hidden_def(__pthread_mutex_destroy)
 strong_alias (__pthread_mutex_destroy, pthread_mutex_destroy)

 int __pthread_mutex_trylock(pthread_mutex_t * mutex)
@@ -90,6 +98,7 @@ int __pthread_mutex_trylock(pthread_mutex_t * mutex)
     return EINVAL;
   }
 }
+libpthread_hidden_def(__pthread_mutex_trylock)
 strong_alias (__pthread_mutex_trylock, pthread_mutex_trylock)

 int __pthread_mutex_lock(pthread_mutex_t * mutex)
@@ -123,6 +132,7 @@ int __pthread_mutex_lock(pthread_mutex_t * mutex)
     return EINVAL;
   }
 }
+libpthread_hidden_def(__pthread_mutex_lock)
 strong_alias (__pthread_mutex_lock, pthread_mutex_lock)

 int __pthread_mutex_timedlock (pthread_mutex_t *mutex,
@@ -198,6 +208,7 @@ int __pthread_mutex_unlock(pthread_mutex_t * mutex)
     return EINVAL;
   }
 }
+libpthread_hidden_def(__pthread_mutex_unlock)
 strong_alias (__pthread_mutex_unlock, pthread_mutex_unlock)

 int __pthread_mutexattr_init(pthread_mutexattr_t *attr)
diff --git a/libpthread/linuxthreads/ptcleanup.c
b/libpthread/linuxthreads/ptcleanup.c
index 6213b56..ccb977c 100644
--- a/libpthread/linuxthreads/ptcleanup.c
+++ b/libpthread/linuxthreads/ptcleanup.c
@@ -40,6 +40,8 @@ demangle_ptr (uintptr_t x)
 #define demangle_ptr(x) x
 #endif

+libpthread_hidden_proto(__pthread_cleanup_upto)
+
 void __pthread_cleanup_upto (__jmp_buf target, char *targetframe)
 {
   pthread_descr self = thread_self();
@@ -72,3 +74,4 @@ void __pthread_cleanup_upto (__jmp_buf target, char
*targetframe)
 			 demangle_ptr))
     THREAD_SETMEM(self, p_in_sighandler, NULL);
 }
+libpthread_hidden_def(__pthread_cleanup_upto)
diff --git a/libpthread/linuxthreads/ptfork.c b/libpthread/linuxthreads/ptfork.c
index 853aeea..0beb859 100644
--- a/libpthread/linuxthreads/ptfork.c
+++ b/libpthread/linuxthreads/ptfork.c
@@ -25,6 +25,8 @@

 extern int __libc_fork (void);

+libpthread_hidden_proto(__pthread_fork)
+
 pid_t __pthread_fork (struct fork_block *b)
 {
   pid_t pid;
@@ -77,6 +79,7 @@ pid_t __pthread_fork (struct fork_block *b)

   return pid;
 }
+libpthread_hidden_def(__pthread_fork)

 /* psm: have no idea why these are here, sjhill? */
 #if 0 /*def SHARED*/
diff --git a/libpthread/linuxthreads/pthread.c
b/libpthread/linuxthreads/pthread.c
index 6ae9a10..959044b 100644
--- a/libpthread/linuxthreads/pthread.c
+++ b/libpthread/linuxthreads/pthread.c
@@ -229,6 +229,62 @@ static void pthread_initialize(void)
__attribute__((constructor));
 extern void *__dso_handle __attribute__ ((weak));
 #endif

+libpthread_hidden_proto(__pthread_fork)
+
+libpthread_hidden_proto(__pthread_attr_destroy)
+libpthread_hidden_proto(__pthread_attr_init)
+libpthread_hidden_proto(__pthread_attr_getdetachstate)
+libpthread_hidden_proto(__pthread_attr_setdetachstate)
+libpthread_hidden_proto(__pthread_attr_getinheritsched)
+libpthread_hidden_proto(__pthread_attr_setinheritsched)
+libpthread_hidden_proto(__pthread_attr_getschedparam)
+libpthread_hidden_proto(__pthread_attr_setschedparam)
+libpthread_hidden_proto(__pthread_attr_getschedpolicy)
+libpthread_hidden_proto(__pthread_attr_setschedpolicy)
+libpthread_hidden_proto(__pthread_attr_getscope)
+libpthread_hidden_proto(__pthread_attr_setscope)
+
+libpthread_hidden_proto(__pthread_condattr_destroy)
+libpthread_hidden_proto(__pthread_condattr_init)
+libpthread_hidden_proto(__pthread_cond_broadcast)
+libpthread_hidden_proto(__pthread_cond_destroy)
+libpthread_hidden_proto(__pthread_cond_init)
+libpthread_hidden_proto(__pthread_cond_signal)
+libpthread_hidden_proto(__pthread_cond_wait)
+libpthread_hidden_proto(__pthread_cond_timedwait)
+
+libpthread_hidden_proto(__pthread_equal)
+
+libpthread_hidden_proto(__pthread_exit)
+
+libpthread_hidden_proto(__pthread_getschedparam)
+libpthread_hidden_proto(__pthread_setschedparam)
+
+libpthread_hidden_proto(__pthread_mutex_destroy)
+libpthread_hidden_proto(__pthread_mutex_init)
+libpthread_hidden_proto(__pthread_mutex_lock)
+libpthread_hidden_proto(__pthread_mutex_trylock)
+libpthread_hidden_proto(__pthread_mutex_unlock)
+
+libpthread_hidden_proto(__pthread_self)
+
+libpthread_hidden_proto(__pthread_setcancelstate)
+libpthread_hidden_proto(__pthread_setcanceltype)
+
+libpthread_hidden_proto(__pthread_do_exit)
+
+libpthread_hidden_proto(__pthread_thread_self)
+
+libpthread_hidden_proto(__pthread_cleanup_upto)
+
+libpthread_hidden_proto(__pthread_sigaction)
+libpthread_hidden_proto(__pthread_sigwait)
+libpthread_hidden_proto(__pthread_raise)
+
+libpthread_hidden_proto(_pthread_cleanup_push)
+libpthread_hidden_proto(_pthread_cleanup_push_defer)
+libpthread_hidden_proto(_pthread_cleanup_pop)
+libpthread_hidden_proto(_pthread_cleanup_pop_restore)

 #if defined USE_TLS && !defined SHARED
 extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
@@ -848,18 +904,21 @@ pthread_descr __pthread_thread_self(void)
 {
   return thread_self();
 }
+libpthread_hidden_def(__pthread_thread_self)

 pthread_t __pthread_self(void)
 {
   pthread_descr self = thread_self();
   return THREAD_GETMEM(self, p_tid);
 }
+libpthread_hidden_def(__pthread_self)
 strong_alias (__pthread_self, pthread_self)

 int __pthread_equal(pthread_t thread1, pthread_t thread2)
 {
   return thread1 == thread2;
 }
+libpthread_hidden_def(__pthread_equal)
 strong_alias (__pthread_equal, pthread_equal)

 /* Helper function for thread_self in the case of user-provided stacks */
@@ -941,6 +1000,7 @@ int __pthread_setschedparam(pthread_t thread, int policy,
     __pthread_manager_adjust_prio(th->p_priority);
   return 0;
 }
+libpthread_hidden_def(__pthread_setschedparam)
 strong_alias (__pthread_setschedparam, pthread_setschedparam)

 int __pthread_getschedparam(pthread_t thread, int *policy,
@@ -962,6 +1022,7 @@ int __pthread_getschedparam(pthread_t thread, int *policy,
   *policy = pol;
   return 0;
 }
+libpthread_hidden_def(__pthread_getschedparam)
 strong_alias (__pthread_getschedparam, pthread_getschedparam)

 /* Process-wide exit() request */
diff --git a/libpthread/linuxthreads/signals.c
b/libpthread/linuxthreads/signals.c
index 02bf1c6..d0153f6 100644
--- a/libpthread/linuxthreads/signals.c
+++ b/libpthread/linuxthreads/signals.c
@@ -24,6 +24,10 @@
 /* mods for uClibc: __libc_sigaction is not in any standard headers */
 extern __typeof(sigaction) __libc_sigaction;

+libpthread_hidden_proto(__pthread_sigaction)
+libpthread_hidden_proto(__pthread_sigwait)
+libpthread_hidden_proto(__pthread_raise)
+
 int pthread_sigmask(int how, const sigset_t * newmask, sigset_t * oldmask)
 {
   sigset_t mask;
@@ -133,6 +137,7 @@ int __pthread_sigaction(int sig, const struct
sigaction * act,
     }
   return 0;
 }
+libpthread_hidden_def(__pthread_sigaction)
 #ifdef SHARED
 strong_alias(__pthread_sigaction, __sigaction)
 strong_alias(__pthread_sigaction, sigaction)
@@ -191,6 +196,7 @@ int __pthread_sigwait(const sigset_t * set, int * sig)
   *sig = THREAD_GETMEM(self, p_signal);
   return 0;
 }
+libpthread_hidden_def(__pthread_sigwait)
 #ifdef SHARED
 strong_alias (__pthread_sigwait, sigwait)
 #endif
@@ -207,6 +213,7 @@ int __pthread_raise (int sig)
     return -1;
   }
 }
+libpthread_hidden_def(__pthread_raise)
 #ifdef SHARED
 strong_alias (__pthread_raise, raise)
 #endif
-- 
1.5.5.2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-linuxthreads-Use-hidden-definitions-when-building-_.patch
Type: application/octet-stream
Size: 21280 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/uclibc/attachments/20100127/cf04b095/attachment-0001.obj>


More information about the uClibc mailing list