about summary refs log tree commit diff
path: root/sysdeps/mach/hurd
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-04-02 18:08:37 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-04-02 18:08:37 +0000
commitf6fb29d22eefb208c0c7da463c31229d50ccbe01 (patch)
tree3db5f5950b7fb2ae65d2fc09f33fab2646687c94 /sysdeps/mach/hurd
parentfa9e15558d711c098183be531043eae465b81036 (diff)
downloadglibc-f6fb29d22eefb208c0c7da463c31229d50ccbe01.tar.gz
glibc-f6fb29d22eefb208c0c7da463c31229d50ccbe01.tar.xz
glibc-f6fb29d22eefb208c0c7da463c31229d50ccbe01.zip
hurd: Avoid local PLTs in libpthread.
	* htl/cthreads-compat.c (__cthread_detach): Call __pthread_detach
	instead of pthread_detach.
	(__cthread_fork): Call __pthread_create instead of pthread_create.
	(__cthread_keycreate): Call __pthread_key_create instead of
	pthread_key_create.
	(__cthread_getspecific): Call __pthread_getspecific instead of
	pthread_getspecific.
	(__cthread_setspecific): Call __pthread_setspecific instead of
	pthread_setspecific.
	* htl/pt-alloc.c (__pthread_alloc): Call __pthread_mutex_lock and
	__pthread_mutex_unlock instead of pthread_mutex_lock and
	pthread_mutex_unlock.
	* htl/pt-cleanup.c (__pthread_get_cleanup_stack): Rename to
	___pthread_get_cleanup_stack.
	(__pthread_get_cleanup_stack): New strong alias.
	* htl/pt-create.c: Include <pthreadP.h>.
	(entry_point): Call __pthread_exit instead of pthread_exit.
	(pthread_create): Rename to __pthread_create.
	(pthread_create): New strong alias.
	* htl/pt-detach.c (pthread_detach): Rename to __pthread_detach.
	(pthread_detach): New strong alias.
	(__pthread_detach): Call __pthread_cond_broadcast instead of
	pthread_cond_broadcast.
	* htl/pt-exit.c (__pthread_exit): Call __pthread_setcancelstate
	instead of pthread_setcancelstate.
	* htl/pt-testcancel.c: Include <pthreadP.h>.
	(pthread_testcancel): Call __pthread_exit instead of pthread_exit.
	* sysdeps/htl/pt-attr-getstack.c: Include <pthreadP.h>
	(__pthread_attr_getstack): Call __pthread_attr_getstackaddr and
	__pthread_attr_getstacksize instead of pthread_attr_getstackaddr and
	pthread_attr_getstacksize.
	* sysdeps/htl/pt-attr-getstackaddr.c (pthread_attr_getstackaddr):
	Rename to __pthread_attr_getstackaddr.
	(pthread_attr_getstackaddr): New strong alias.
	* sysdeps/htl/pt-attr-getstacksize.c (pthread_attr_getstacksize):
	Rename to __pthread_attr_getstacksize.
	(pthread_attr_getstacksize): New strong alias.
	* sysdeps/htl/pt-attr-setstack.c: Include <pthreadP.h>.
	(pthread_attr_setstack): Rename to __pthread_attr_setstack.
	(pthread_attr_setstack): New strong alias.
	(__pthread_attr_setstack): Call __pthread_attr_getstacksize,
	__pthread_attr_setstacksize and __pthread_attr_setstackaddr instead of
	pthread_attr_getstacksize, pthread_attr_setstacksize and
	pthread_attr_setstackaddr.
	* sysdeps/htl/pt-attr-setstackaddr.c (pthread_attr_setstackaddr):
	Rename to __pthread_attr_setstackaddr.
	(pthread_attr_setstackaddr): New strong alias.
	* sysdeps/htl/pt-attr-setstacksize.c (pthread_attr_setstacksize):
	Rename to __pthread_attr_setstacksize.
	(pthread_attr_setstacksize): New strong alias.
	* sysdeps/htl/pt-cond-timedwait.c: Include <pthreadP.h>.
	(__pthread_cond_timedwait_internal): Use __pthread_exit instead of
	pthread_exit.
	* sysdeps/htl/pt-key-create.c: Include <pthreadP.h>.
	(__pthread_key_create): New hidden def.
	* sysdeps/htl/pt-key.h: Include <pthreadP.h>.
	* sysdeps/htl/pthreadP.h (_pthread_mutex_init,
	__pthread_cond_broadcast, __pthread_create, __pthread_detach,
	__pthread_exit, __pthread_key_create, __pthread_getspecific,
	__pthread_setspecific, __pthread_setcancelstate,
	__pthread_attr_getstackaddr, __pthread_attr_setstackaddr,
	__pthread_attr_getstacksize, __pthread_attr_setstacksize,
	__pthread_attr_setstack, ___pthread_get_cleanup_stack): New
	declarations.
	(__pthread_key_create, _pthread_mutex_init): New hidden declarations.
	* sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c
	(pthread_attr_setstackaddr): Rename to __pthread_attr_setstackaddr.
	(pthread_attr_setstackaddr): New strong alias.
	* sysdeps/mach/hurd/htl/pt-attr-setstacksize.c
	(pthread_attr_setstacksize): Rename to __pthread_attr_setstacksize.
	(pthread_attr_setstacksize): New strong alias.
	* sysdeps/mach/hurd/htl/pt-docancel.c: Include <pthreadP.h>.
	(call_exit): Call __pthread_exit instead of pthread_exit.
	* sysdeps/mach/hurd/htl/pt-mutex-init.c: Include <pthreadP.h>.
	(_pthread_mutex_init): New hidden definition.
	* sysdeps/mach/hurd/htl/pt-sysdep.c: Include <pthreadP.h>.
	(_init_routine): Call __pthread_attr_init and __pthread_attr_setstack
	instead of pthread_attr_init and pthread_attr_setstack.
Diffstat (limited to 'sysdeps/mach/hurd')
-rw-r--r--sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c3
-rw-r--r--sysdeps/mach/hurd/htl/pt-attr-setstacksize.c3
-rw-r--r--sysdeps/mach/hurd/htl/pt-docancel.c3
-rw-r--r--sysdeps/mach/hurd/htl/pt-mutex-init.c2
-rw-r--r--sysdeps/mach/hurd/htl/pt-sysdep.c5
5 files changed, 11 insertions, 5 deletions
diff --git a/sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c b/sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c
index 3c0d73d1e8..ff6bee83d0 100644
--- a/sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c
+++ b/sysdeps/mach/hurd/htl/pt-attr-setstackaddr.c
@@ -20,8 +20,9 @@
 #include <pt-internal.h>
 
 int
-pthread_attr_setstackaddr (pthread_attr_t *attr, void *stackaddr)
+__pthread_attr_setstackaddr (pthread_attr_t *attr, void *stackaddr)
 {
   attr->__stackaddr = stackaddr;
   return 0;
 }
+strong_alias (__pthread_attr_setstackaddr, pthread_attr_setstackaddr)
diff --git a/sysdeps/mach/hurd/htl/pt-attr-setstacksize.c b/sysdeps/mach/hurd/htl/pt-attr-setstacksize.c
index 9aff6ba7ac..e5c59d14b4 100644
--- a/sysdeps/mach/hurd/htl/pt-attr-setstacksize.c
+++ b/sysdeps/mach/hurd/htl/pt-attr-setstacksize.c
@@ -20,8 +20,9 @@
 #include <pt-internal.h>
 
 int
-pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize)
+__pthread_attr_setstacksize (pthread_attr_t *attr, size_t stacksize)
 {
   attr->__stacksize = stacksize;
   return 0;
 }
+strong_alias (__pthread_attr_setstacksize, pthread_attr_setstacksize)
diff --git a/sysdeps/mach/hurd/htl/pt-docancel.c b/sysdeps/mach/hurd/htl/pt-docancel.c
index 839529cdbb..6e9428ce57 100644
--- a/sysdeps/mach/hurd/htl/pt-docancel.c
+++ b/sysdeps/mach/hurd/htl/pt-docancel.c
@@ -19,11 +19,12 @@
 #include <pthread.h>
 
 #include <pt-internal.h>
+#include <pthreadP.h>
 
 static void
 call_exit (void)
 {
-  pthread_exit (0);
+  __pthread_exit (0);
 }
 
 int
diff --git a/sysdeps/mach/hurd/htl/pt-mutex-init.c b/sysdeps/mach/hurd/htl/pt-mutex-init.c
index c90fc35d23..687a4c0e67 100644
--- a/sysdeps/mach/hurd/htl/pt-mutex-init.c
+++ b/sysdeps/mach/hurd/htl/pt-mutex-init.c
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include <assert.h>
 #include <pt-internal.h>
+#include <pthreadP.h>
 #include "pt-mutex.h"
 #include <hurdlock.h>
 
@@ -53,3 +54,4 @@ _pthread_mutex_init (pthread_mutex_t *mtxp, const pthread_mutexattr_t *attrp)
 }
 
 strong_alias (_pthread_mutex_init, pthread_mutex_init)
+hidden_def (_pthread_mutex_init)
diff --git a/sysdeps/mach/hurd/htl/pt-sysdep.c b/sysdeps/mach/hurd/htl/pt-sysdep.c
index 4342d6d21b..673f048c37 100644
--- a/sysdeps/mach/hurd/htl/pt-sysdep.c
+++ b/sysdeps/mach/hurd/htl/pt-sysdep.c
@@ -24,6 +24,7 @@
 #include <mach/mig_support.h>
 
 #include <pt-internal.h>
+#include <pthreadP.h>
 
 __thread struct __pthread *___pthread_self;
 
@@ -57,8 +58,8 @@ _init_routine (void *stack)
          while the main program was not linked against libpthread.  */
       /* Avoid allocating another stack */
       attrp = &attr;
-      pthread_attr_init (attrp);
-      pthread_attr_setstack (attrp, stack, __vm_page_size);
+      __pthread_attr_init (attrp);
+      __pthread_attr_setstack (attrp, stack, __vm_page_size);
     }
 
   /* Create the pthread structure for the main thread (i.e. us).  */