glibc/sysdeps
Florian Weimer a509eb117f Avoid late dlopen failure due to scope, TLS slotinfo updates [BZ #25112]
This change splits the scope and TLS slotinfo updates in dlopen into
two parts: one to resize the data structures, and one to actually apply
the update.  The call to add_to_global_resize in dl_open_worker is moved
before the demarcation point at which no further memory allocations are
allowed.

_dl_add_to_slotinfo is adjusted to make the list update optional.  There
is some optimization possibility here because we could grow the slotinfo
list of arrays in a single call, one the largest TLS modid is known.

This commit does not fix the fatal meory allocation failure in
_dl_update_slotinfo.  Ideally, this error during dlopen should be
recoverable.

The update order of scopes and TLS data structures is retained, although
it appears to be more correct to fully initialize TLS first, and then
expose symbols in the newly loaded objects via the scope update.

Tested on x86_64-linux-gnu.

Change-Id: I240c58387dabda3ca1bcab48b02115175fa83d6c
2019-11-27 20:55:35 +01:00
..
aarch64 nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
alpha nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
arm nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
csky nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
generic Avoid late dlopen failure due to scope, TLS slotinfo updates [BZ #25112] 2019-11-27 20:55:35 +01:00
gnu Add TCP_TX_DELAY from Linux 5.3 to netinet/tcp.h. 2019-09-27 13:37:36 +00:00
hppa nptl: Add struct_rwlock.h 2019-11-26 13:53:36 +00:00
htl time: Introduce function to check correctness of nanoseconds value 2019-10-27 21:49:25 +01:00
hurd Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
i386 nptl: Add tests for internal pthread_rwlock_t offsets 2019-11-26 13:53:36 +00:00
ia64 nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
ieee754 ldbl-128ibm-compat: Add syslog functions 2019-11-27 15:52:41 -03:00
init_array Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
m68k nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
mach hurd: Suppress GCC 10 -Warray-bounds warning in init-first.c [BZ #25097] 2019-11-16 15:40:59 +01:00
microblaze nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
mips nptl: Add struct_rwlock.h 2019-11-26 13:53:36 +00:00
nios2 nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
nptl nptl: Fix __PTHREAD_MUTEX_INITIALIZER for !__PTHREAD_MUTEX_HAVE_PREV 2019-11-26 17:00:19 -03:00
posix sysdeps/posix/getaddrinfo: Return early on invalid address family 2019-11-26 10:19:33 +01:00
powerpc nptl: Add default pthreadtypes-arch.h 2019-11-26 13:53:36 +00:00
pthread Change most internal uses of __gettimeofday to __clock_gettime. 2019-10-30 17:04:10 -03:00
riscv nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
s390 S390: Fix handling of needles crossing a page in strstr z15 ifunc-variant. [BZ #25226] 2019-11-27 12:35:40 +01:00
sh nptl: Add default pthread-offsets.h 2019-11-26 13:53:36 +00:00
sparc sparc: Use atomic compiler builtins on sparc 2019-11-27 10:31:13 -03:00
unix sparc: Use atomic compiler builtins on sparc 2019-11-27 10:31:13 -03:00
wordsize-32 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
wordsize-64 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
x86 nptl: Add struct_rwlock.h 2019-11-26 13:53:36 +00:00
x86_64 nptl: Add tests for internal pthread_rwlock_t offsets 2019-11-26 13:53:36 +00:00