glibc/sysdeps/mach/hurd/x86_64
Sergey Bugaev e275690332 hurd: Only check for TLS initialization inside rtld or in static builds
When glibc is built as a shared library, TLS is always initialized by
the call of TLS_INIT_TP () macro made inside the dynamic loader, prior
to running the main program (see dl-call_tls_init_tp.h). We can take
advantage of this: we know for sure that __LIBC_NO_TLS () will evaluate
to 0 in all other cases, so let the compiler know that explicitly too.

Also, only define _hurd_tls_init () and TLS_INIT_TP () under the same
conditions (either !SHARED or inside rtld), to statically assert that
this is the case.

Other than a microoptimization, this also helps with avoiding awkward
sharing of the __libc_tls_initialized variable between ld.so and libc.so
that we would have to do otherwise -- we know for sure that no sharing
is required, simply because __libc_tls_initialized would always be set
to true inside libc.so.

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
Message-Id: <20230319151017.531737-25-bugaevc@gmail.com>
2023-04-14 10:31:22 +00:00
..
bits hurd: Add sys/ucontext.h and sigcontext.h for x86_64 2023-04-10 20:11:43 +02:00
htl htl: Implement thread_set_pcsptp for x86_64 2023-04-03 01:18:27 +02:00
dl-tls-initialized.c hurd: Only check for TLS initialization inside rtld or in static builds 2023-04-14 10:31:22 +00:00
Implies
intr-msg.h hurd: Implement x86_64/intr-msg.h 2023-04-10 20:39:28 +02:00
longjmp-ts.c hurd: Implement _hurd_longjmp_thread_state for x86_64 2023-04-03 01:23:30 +02:00
static-start.S hurd, htl: Add some x86_64-specific code 2023-02-12 16:35:03 +01:00
tls.h hurd: Only check for TLS initialization inside rtld or in static builds 2023-04-14 10:31:22 +00:00
tlsdesc.sym hurd, htl: Add some x86_64-specific code 2023-02-12 16:35:03 +01:00
ucontext_i.sym hurd: Add sys/ucontext.h and sigcontext.h for x86_64 2023-04-10 20:11:43 +02:00
vm_param.h hurd: Add vm_param.h for x86_64 2023-04-03 01:24:13 +02:00