]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
rtld: ignore static TLS segments when tracing.
authorkib <kib@FreeBSD.org>
Wed, 22 Apr 2020 18:39:45 +0000 (18:39 +0000)
committerkib <kib@FreeBSD.org>
Wed, 22 Apr 2020 18:39:45 +0000 (18:39 +0000)
commit25623b16dd6b5cb89058acc0962346a6ff18883f
tree94fd137f747a0e7349590ec8d7a51719b3224166
parentf218cf928067eaa260e85bd2d2c7a4047b01219f
rtld: ignore static TLS segments when tracing.

For PIE binaries, ldd(1) performs dlopen(RTLD_TRACE) on the binary.
It is legal for binary to use initial exec TLS mode, but when such
binary (actually dso) is dlopened, we might not have enough free space
in the finalized static TLS segment.  Make ldd operational by skipping
TLS space allocation, we are not going to execute any code from the
dso anyway.

Reported by: tobik
PR: 245677
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
libexec/rtld-elf/rtld.c
libexec/rtld-elf/rtld.h