freebsd-skq/lib/libthr/thread
kib 9638d3e2e6 Fix initial exec TLS mode for dynamically loaded shared objects.
If dso uses initial exec TLS mode, rtld tries to allocate TLS in
static space. If there is no space left, the dlopen(3) fails. If space
if allocated, initial content from PT_TLS segment is distributed to
all threads' pcbs, which was missed and caused un-initialized TLS
segment for such dso after dlopen(3).

The mode is auto-detected either due to the relocation used, or if the
DF_STATIC_TLS dynamic flag is set.  In the later case, the TLS segment
is tried to allocate earlier, which increases chance of the dlopen(3)
to succeed.  LLD was recently fixed to properly emit the flag, ld.bdf
did it always.

Initial test by:	dumbbell
Tested by:	emaste (amd64), ian (arm)
Tested by:	Gerald Aryeetey <aryeeteygerald_rogers.com> (arm64)
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D19072
2019-03-29 17:52:57 +00:00
..
Makefile.inc Untangle jemalloc and mutexes initialization. 2019-01-29 22:46:44 +00:00
thr_affinity.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_attr.c libthr: minor spacing cleanup. 2018-08-21 01:33:25 +00:00
thr_autoinit.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
thr_barrier.c POSIX compliance improvements in the pthread(3) functions. 2018-08-18 01:05:38 +00:00
thr_barrierattr.c POSIX compliance improvements in the pthread(3) functions. 2018-08-18 01:05:38 +00:00
thr_cancel.c Ensure thread library is initialized in pthread_testcancel(). 2018-03-21 21:13:26 +00:00
thr_clean.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
thr_concurrency.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
thr_cond.c Have pthread_cond_destroy() return EBUSY if the condvar has waiters. 2019-03-08 21:07:08 +00:00
thr_condattr.c POSIX compliance improvements in the pthread(3) functions. 2018-08-18 01:05:38 +00:00
thr_create.c _thr_setthreaded() cannot fail; change return type to void 2018-11-30 03:01:32 +00:00
thr_ctrdtr.c
thr_detach.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_equal.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
thr_event.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_exit.c Add pthread_get_name_np(3). 2018-08-17 18:34:07 +00:00
thr_fork.c Untangle jemalloc and mutexes initialization. 2019-01-29 22:46:44 +00:00
thr_getcpuclockid.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_getprio.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
thr_getschedparam.c POSIX compliance improvements in the pthread(3) functions. 2018-08-18 01:05:38 +00:00
thr_getthreadid_np.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_info.c Add pthread_get_name_np(3). 2018-08-17 18:34:07 +00:00
thr_init.c Untangle jemalloc and mutexes initialization. 2019-01-29 22:46:44 +00:00
thr_join.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_kern.c _thr_setthreaded() cannot fail; change return type to void 2018-11-30 03:01:32 +00:00
thr_kill.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
thr_list.c Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
thr_main_np.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_malloc.c Fixes for very early use of the pthread_mutex_* and libthr malloc. 2019-02-04 21:16:15 +00:00
thr_multi_np.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
thr_mutex.c Fixes for very early use of the pthread_mutex_* and libthr malloc. 2019-02-04 21:16:15 +00:00
thr_mutexattr.c POSIX compliance improvements in the pthread(3) functions. 2018-08-18 01:05:38 +00:00
thr_once.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_printf.c libthr: Fix missing break in switch. 2018-01-27 22:27:55 +00:00
thr_private.h Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
thr_pshared.c
thr_pspinlock.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_resume_np.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
thr_rtld.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_rwlock.c POSIX compliance improvements in the pthread(3) functions. 2018-08-18 01:05:38 +00:00
thr_rwlockattr.c POSIX compliance improvements in the pthread(3) functions. 2018-08-18 01:05:38 +00:00
thr_self.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
thr_sem.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_setprio.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
thr_setschedparam.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
thr_sig.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_single_np.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
thr_sleepq.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_spec.c Untangle jemalloc and mutexes initialization. 2019-01-29 22:46:44 +00:00
thr_spinlock.c Use _thr_isthreaded() and _thr_setthreaded() wrappers 2018-11-30 03:02:49 +00:00
thr_stack.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_suspend_np.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
thr_switch_np.c spdx: initial adoption of licensing ID tags. 2017-11-18 14:26:50 +00:00
thr_symbols.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
thr_syscalls.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00
thr_umtx.c lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_umtx.h lib: further adoption of SPDX licensing ID tags. 2017-11-26 02:00:33 +00:00
thr_yield.c General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00