freebsd-dev/libexec/rtld-elf
Konstantin Belousov 1005d3d053 rtld: fix dlopen() for an object that is already mapped but not yet initialized
For instance, dso might be mapped as needed but not yet initialized from
the other subtree of needed objects, while current object' constructor
does dlopen() for the dso.  Right now rtld does relocations and other
processing based on the arrival of new objects in the global list, which
is not happens there.  Directly check for the initialization state of
the object, for which we would return the handle.

One practical use case of this support is e.g. dlopen("libthr.so",
RTLD_NOLOAD) by libraries that are threading-aware but happy to live
with libc pthread shims if the program is not multithreaded.

Reviewed by:	tijl
Sponsored by:	The FreeBSD Foundation
MFC after:	2 weeks
2023-07-16 15:34:34 +03:00
..
aarch64 rtld: Annotate .rtld_start on aarch64 2023-07-07 19:55:28 +03:00
amd64 rtld: Add a stop indicator to rtld_start to satisfy unwinders on x86_64 2023-07-01 10:51:35 +03:00
arm rtld-elf: Remove set but unused variable on 32-bit arm. 2023-06-20 09:29:00 -07:00
i386 rtld: Annotate .rtld_start on i386 2023-07-11 15:10:32 +03:00
powerpc rtld: rename tls_done to tls_static 2023-06-05 22:33:17 +03:00
powerpc64 rtld: rename tls_done to tls_static 2023-06-05 22:33:17 +03:00
riscv rtld: rename tls_done to tls_static 2023-06-05 22:33:17 +03:00
rtld-libc Have rtld query the page size from the kernel 2022-04-07 15:37:37 +01:00
tests spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
debug.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
debug.h rtld-elf: Reuse _BASENAME_RTLD for debug.h rather than duplicating logic 2023-07-09 18:45:49 +01:00
libmap.c rtld: fix typo in comment 2022-10-17 17:10:03 +03:00
libmap.conf
libmap.h rtld-elf/libmap.h: style declarations 2022-09-19 01:49:41 +03:00
Makefile rtld: don't add extraneous -L directory when MK_TOOLCHAIN == no 2023-05-02 18:01:43 -04:00
Makefile.depend Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
map_object.c rtld: rename tls_done to tls_static 2023-06-05 22:33:17 +03:00
rtld_lock.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
rtld_lock.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
rtld_malloc.c rtld-elf/paths.h: Make it usable outside rtld 2021-10-21 03:08:54 +03:00
rtld_malloc.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
rtld_paths.h rtld-elf: Remove _PATH_ELF32_HINTS and _COMPAT32_PATH_RTLD 2023-07-09 18:50:30 +01:00
rtld_printf.c rtld: add rtld_fdprintfx() 2021-11-13 19:33:13 +02:00
rtld_printf.h spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
rtld_tls.h rtld_tls.h: style 2023-06-05 22:33:17 +03:00
rtld_utrace.h
rtld.1 rtld: add support for the $LIB token 2022-11-11 12:06:30 +02:00
rtld.c rtld: fix dlopen() for an object that is already mapped but not yet initialized 2023-07-16 15:34:34 +03:00
rtld.h rtld: do not allow both dynamic DTV index and static TLS offset 2023-06-05 22:33:18 +03:00
Symbol.map rtld dl_iterate_phdr(): dlpi_tls_data is wrong 2021-04-06 03:23:08 +03:00
xmalloc.c spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00