freebsd-nq/lib/libc/i386
Konstantin Belousov 5d00c5a657 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
..
gen Unify i386 and amd64 getcontextx.c, and use ifuncs while there. 2019-02-14 14:02:33 +00:00
stdlib
string amd64: depessimize userspace memcpy/memmove/bcopy 2018-09-17 15:49:35 +00:00
sys Reimplement brk() and sbrk() to avoid the use of _end. 2018-06-04 19:35:15 +00:00
_fpmath.h libc: further adoption of SPDX licensing ID tags. 2017-11-25 17:12:48 +00:00
arith.h
gd_qnan.h
Makefile.inc revert r322589: force use of ld.bfd for linking i386 libc 2017-12-16 15:17:54 +00:00
static_tls.h Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
Symbol.map Add usermode helpers for for Intel userspace protection keys feature. 2019-02-20 09:56:23 +00:00
SYS.h General further adoption of SPDX licensing ID tags. 2017-11-20 19:49:47 +00:00