freebsd-nq/lib/libc/gen
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
..
__getosreldate.c
__pthread_mutex_init_calloc_cb_stub.c
__xuname.c
_once_stub.c
_pthread_stubs.c
_rand48.c
_spinlock_stub.c
_thread_init.c
alarm.3
alarm.c
arc4random_uniform.c
arc4random-compat.c
arc4random.3 arc4random: Adjust example code to use uniform() API 2019-03-21 14:45:08 +00:00
arc4random.c
arc4random.h
assert.c
auxv.c
basename_compat.c
basename.3
basename.c
cap_rights_get.3
cap_sandboxed.3
cap_sandboxed.c
check_utility_compat.3
check_utility_compat.c
clock_getcpuclockid.3
clock_getcpuclockid.c
clock.3
clock.c
closedir.c
confstr.3
confstr.c
crypt.c
ctermid.3
ctermid.c
daemon.3
daemon.c
devname-compat11.c
devname.3
devname.c
directory.3
dirfd.c
dirname_compat.c
dirname.3
dirname.c
disklabel.c
dl_iterate_phdr.3
dladdr.3
dlfcn.c
dlinfo.3
dllockinit.3
dlopen.3 Revert r343093 until I can address the issues raised by kib@. 2019-01-17 16:50:50 +00:00
drand48.c
dup3.3
dup3.c
elf_utils.c Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
erand48.c
err.3
err.c
errlst.c Create new EINTEGRITY error with message "Integrity check failed". 2019-01-17 06:35:45 +00:00
errno.c
exec.3
exec.c
exect.c
fdevname.c
feature_present.3
feature_present.c
fmtcheck.3
fmtcheck.c
fmtmsg.3
fmtmsg.c
fnmatch.3
fnmatch.c
fpclassify.3
fpclassify.c
frexp.3
frexp.c
fstab.c
ftok.3
ftok.c
fts-compat11.c DTF_REWIND does nothing (since r247236) so retire its use 2019-03-26 19:35:41 +00:00
fts-compat11.h
fts-compat.c DTF_REWIND does nothing (since r247236) so retire its use 2019-03-26 19:35:41 +00:00
fts-compat.h
fts.3
fts.c DTF_REWIND does nothing (since r247236) so retire its use 2019-03-26 19:35:41 +00:00
ftw-compat11.c
ftw.3
ftw.c
gen-compat.h
gen-private.h
getbootfile.3
getbootfile.c
getbsize.3
getbsize.c
getcap.3
getcap.c
getcontext.3
getcwd.3
getcwd.c
getdiskbyname.3
getdomainname.3
getdomainname.c
getentropy.3
getentropy.c
getfsent.3
getgrent.3
getgrent.c
getgrouplist.3
getgrouplist.c
gethostname.3
gethostname.c
getloadavg.3
getloadavg.c
getlogin.c
getmntinfo-compat11.c
getmntinfo.3
getmntinfo.c
getnetgrent.3
getnetgrent.c
getosreldate.3
getosreldate.c
getpagesize.3
getpagesize.c
getpagesizes.3
getpagesizes.c
getpass.3
getpeereid.3
getpeereid.c
getprogname.3
getprogname.c
getpwent.3
getpwent.c
getttyent.3
getttyent.c
getusershell.3
getusershell.c
getutxent.3
getutxent.c
getvfsbyname.3
getvfsbyname.c
glob-compat11.c
glob-compat11.h
glob.3
glob.c
initgroups.3
initgroups.c
isatty.c
isgreater.3
isinf.c
isnan.c
jrand48.c
lcong48.c
ldexp.3
ldexp.c
libc_dlopen.c
lockf.3
lockf.c
lrand48.c
makecontext.3
Makefile.inc Add man page for dlvsym(3) 2019-01-03 21:31:17 +00:00
modf.3
modf.c
mrand48.c
nftw-compat11.c
nftw.c
nice.3
nice.c
nlist.3
nlist.c
nrand48.c
opendir.c
pause.3
pause.c
pmadvise.c
popen.3
popen.c
posix_spawn_file_actions_addopen.3
posix_spawn_file_actions_init.3
posix_spawn.3
posix_spawn.c
posix_spawnattr_getflags.3
posix_spawnattr_getpgroup.3
posix_spawnattr_getschedparam.3
posix_spawnattr_getschedpolicy.3
posix_spawnattr_getsigdefault.3
posix_spawnattr_getsigmask.3
posix_spawnattr_init.3
psignal.3
psignal.c
pututxline.c
pw_scan.c
pw_scan.h
raise.3
raise.c
rand48.3
rand48.h
readdir-compat11.c
readdir.c
readpassphrase.3 Note that readpassphrase() came into FreeBSD's libc at 4.6. 2019-02-13 04:52:01 +00:00
readpassphrase.c
recvmmsg.c
rewinddir.c
rfork_thread.3
scandir_b.c
scandir-compat11.c
scandir.3
scandir.c
seed48.c
seekdir.c
sem_destroy.3
sem_getvalue.3
sem_init.3
sem_new.c
sem_open.3
sem_post.3
sem_timedwait.3
sem_wait.3
sem.c
semctl.c
sendmmsg.c
setdomainname.c
sethostname.c
setjmp.3
setjmperr.c
setmode.3
setmode.c
setproctitle.3
setproctitle.c
setprogname.c
shells
siginterrupt.3
siginterrupt.c
siglist.c
signal.3
signal.c
sigsetops.3
sigsetops.c
sleep.3
sleep.c
srand48.c
statvfs.3
statvfs.c
stringlist.3
stringlist.c
strtofflags.3
strtofflags.c
Symbol.map Fix initial exec TLS mode for dynamically loaded shared objects. 2019-03-29 17:52:57 +00:00
sysconf.3
sysconf.c
sysctl.3 Add descriptions for sysctls in kern_mib.c and sysctl.3 which lack them. 2019-03-23 19:53:15 +00:00
sysctl.c
sysctlbyname.c
sysctlnametomib.c
syslog.3
syslog.c
tcgetpgrp.3
tcgetsid.3
tcsendbreak.3
tcsetattr.3
tcsetpgrp.3
tcsetsid.3
telldir.c
telldir.h
termios.c
time.3
time.c
times.3
times.c
timespec_get.3
timespec_get.c
timezone.3
timezone.c
tls.c
trivial-getcontextx.c
ttyname.3
ttyname.c
ttyslot.c
tzset.3
ualarm.3
ualarm.c
ucontext.3
ulimit.3
ulimit.c
uname.3
uname.c
unvis-compat.c
usleep.3
usleep.c
utime.3
utime.c
utxdb.c
utxdb.h
valloc.3
valloc.c
wait3.c
wait.c
waitid.c
waitpid.c
wordexp.3
wordexp.c