Commit Graph

14 Commits

Author SHA1 Message Date
joerg 336e4f812b Use alignof and not size_t for platforms with non-natural base
alignments.
2019-11-05 22:22:42 +00:00
joerg a0e0f8b685 PR 54093: Align static TLS area to max_align_t. 2019-11-04 12:45:10 +00:00
rin e66054b66e Do not compile __tls_get_addr() into ldd(1), which fixes ldd(1) crashing
on arm after switching to new jemalloc.

jemalloc invokes __tls_get_addr() under some condition. If anything other
than ld.elf_so nor libc exports it, inconsistency arises as a result.
2019-04-13 00:23:32 +00:00
joerg bde7a58ae6 Fix two bugs related to promotion of DSO TLS blocks into the static
thread allocation:
(1) Set the DTV vector up whenever an offset into the static allocation
is assigned, even if the block itself is not initialized. This has been
seen in libstdc++.
(2) Do not free a DTV block if it is part of the static thread
allocation.
2017-07-13 14:10:38 +00:00
chs a60c43758e fix powerpc TLS problems by removing the hacks for PPC EABI.
the kernel no longer treats R2 specially and its use as
the TLS register is now handled entirely in userland.
2014-12-14 23:49:17 +00:00
joerg 5e2fc1bbd3 Only initialise TLS space from the PT_TLS segment, if the size is
positive and the offset has been computed. Fixes PR lib/48324.
2013-10-21 19:14:15 +00:00
skrll 3ea7549453 Add debug code. 2013-10-19 10:14:06 +00:00
joerg c5f8d1393d Fix a Freudian slip found by rmind 2011-04-23 16:40:08 +00:00
matt 14d704c9e9 Add a workaround for older crt0.o that overwrite r2 (tcb pointer).
(save tcb pointer using _lwp_setprivate in ld.elf_so and retrieve the tcb
via _lwp_getprivate in libc and use it to restore the value in r2).
2011-04-07 02:19:28 +00:00
joerg 8fa6585514 Block signals when using the exclusive lock. 2011-03-29 20:56:35 +00:00
joerg cb1cd7e860 Add basic locking to ld.elf_so. 2011-03-25 18:07:04 +00:00
matt 130f2d3d4c Add TLS support for PowerPC.
If the port has __lwp_gettcb_fast or __lwp_settcb use them instead of
__lwp_getprivate_fast or lwp_setprivate.
2011-03-12 07:43:53 +00:00
joerg de4cf97515 Fix prototype for __tls_get_addr. Add a generic implementation of it
using __tls_get_addr. Update TLS notes.
2011-03-10 14:27:31 +00:00
joerg aad599979d Add TLS support infrastructure. For dynamic binaries, ld.elf_so exports
_rtld_tls_allocate and _rtld_tls_free. libpthread uses this functions to
setup the thread private area of all new threads. ld.elf_so is
responsible for setting up the private area for the initial thread.
Similar functions are called from _libc_init for static binaries, using
dl_iterate_phdr to access the ELF Program Header.

Add test cases to exercise the different TLS storage models. Test cases
are compiled and installed on all platforms, but are skipped on
platforms not marked for TLS support.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.

It is inspired by the TLS support in FreeBSD by Doug Rabson and the
clean ups of the DragonFly port of the original FreeBSD modifications.
2011-03-09 23:10:05 +00:00