From 166bb3eac351b88191d440b0fe8d5d7b757eaed0 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Wed, 15 Sep 2021 20:11:08 +0300 Subject: htl: Move thread table to ld.so The next commit is going to introduce a new implementation of THREAD_GSCOPE_WAIT which needs to access the list of threads. Since it must be usable from the dynamic laoder, we have to move the symbols for the list of threads into the loader. Signed-off-by: Sergey Bugaev Message-Id: <20210915171110.226187-2-bugaevc@gmail.com> Reviewed-by: Samuel Thibault --- sysdeps/mach/hurd/htl/pt-sigstate-init.c | 2 +- sysdeps/mach/hurd/htl/pt-sysdep.c | 2 +- sysdeps/mach/hurd/htl/pt-sysdep.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'sysdeps/mach/hurd') diff --git a/sysdeps/mach/hurd/htl/pt-sigstate-init.c b/sysdeps/mach/hurd/htl/pt-sigstate-init.c index 399068ca78..6f43ade653 100644 --- a/sysdeps/mach/hurd/htl/pt-sigstate-init.c +++ b/sysdeps/mach/hurd/htl/pt-sigstate-init.c @@ -37,7 +37,7 @@ __pthread_sigstate_init (struct __pthread *thread) struct hurd_sigstate *ss = _hurd_thread_sigstate (thread->kernel_thread); _hurd_sigstate_set_global_rcv (ss); } - else if (__pthread_num_threads >= 2) + else if (GL (dl_pthread_num_threads) >= 2) do_init_global = 1; return 0; diff --git a/sysdeps/mach/hurd/htl/pt-sysdep.c b/sysdeps/mach/hurd/htl/pt-sysdep.c index 03ff8079ba..2fd0a8d6e7 100644 --- a/sysdeps/mach/hurd/htl/pt-sysdep.c +++ b/sysdeps/mach/hurd/htl/pt-sysdep.c @@ -45,7 +45,7 @@ _init_routine (void *stack) int err; pthread_attr_t attr, *attrp = 0; - if (__pthread_threads != NULL) + if (GL (dl_pthread_threads) != NULL) /* Already initialized */ return; diff --git a/sysdeps/mach/hurd/htl/pt-sysdep.h b/sysdeps/mach/hurd/htl/pt-sysdep.h index acd4fce9c4..d90563af0c 100644 --- a/sysdeps/mach/hurd/htl/pt-sysdep.h +++ b/sysdeps/mach/hurd/htl/pt-sysdep.h @@ -37,7 +37,7 @@ extern __thread struct __pthread *___pthread_self; ({ \ struct __pthread *thread; \ \ - assert (__pthread_threads); \ + assert (GL (dl_pthread_threads)); \ thread = ___pthread_self; \ \ assert (thread); \ -- cgit 1.4.1