1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 22:48:11 +00:00
serenity/Userland/Libraries/LibELF
Daniel Bertalan ad9e674fa0 LibC+LibELF: Support loading shared libraries compiled with dynamic TLS
This is a prerequisite for upstreaming our LLVM patches, as our current
hack forcing `-ftls-model=initial-exec` in the Clang driver is not
acceptable upstream.

Currently, our kernel-managed TLS implementation limits us to only
having a single block of storage for all thread-local variables that's
initialized at load time. This PR merely implements the dynamic TLS
interface (`__tls_get_addr` and TLSDESC) on top of our static TLS
infrastructure. The current model's limitations still stand:
- a single static TLS block is reserved at load time, `dlopen()`-ing
  shared libraries that define thread-local variables might cause us to
  run out of space.
- the initial TLS image is not changeable post-load, so `dlopen()`-ing
  libraries with non-zero-initialized TLS variables is not supported.

The way we repurpose `ti_module` to mean "offset within static TLS
block" instead of "module index" is not ABI-compliant.
2023-08-18 16:20:13 +02:00
..
Arch LibC+LibELF: Support loading shared libraries compiled with dynamic TLS 2023-08-18 16:20:13 +02:00
AuxiliaryVector.h Kernel+Libraries: Move defines and types from sys/auxv.h to Kernel/API 2023-01-21 10:43:59 -07:00
CMakeLists.txt LibC+LibELF: Move ELF definitions from LibC to LibELF 2023-06-27 12:40:38 +02:00
Core.h Everywhere: Remove exceptions for using #include <LibC/...> 2023-06-27 12:40:38 +02:00
DynamicLinker.cpp Everywhere: Remove exceptions for using #include <LibC/...> 2023-06-27 12:40:38 +02:00
DynamicLinker.h LibELF: Export static resolve_library method of the DynamicLinker code 2022-12-31 05:06:39 -07:00
DynamicLoader.cpp LibC+LibELF: Support loading shared libraries compiled with dynamic TLS 2023-08-18 16:20:13 +02:00
DynamicLoader.h Everywhere: Remove needless trailing semi-colons after functions 2023-07-08 10:32:56 +01:00
DynamicObject.cpp LibC+LibELF: Move ELF definitions from LibC to LibELF 2023-06-27 12:40:38 +02:00
DynamicObject.h LibC+LibELF: Move ELF definitions from LibC to LibELF 2023-06-27 12:40:38 +02:00
ELFABI.h LibELF+readelf: Add missing constants for dynamic relocations 2023-08-18 16:20:13 +02:00
Hashes.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
Image.cpp Kernel: Consolidate finding the ELF stack size with validation 2023-07-10 21:08:31 -06:00
Image.h LibC+LibELF: Move ELF definitions from LibC to LibELF 2023-06-27 12:40:38 +02:00
Relocation.cpp LibC+LibELF: Move ELF definitions from LibC to LibELF 2023-06-27 12:40:38 +02:00
Relocation.h Kernel: Move {Virtual,Physical}Address classes to the Memory directory 2023-06-04 21:32:34 +02:00
Validation.cpp Kernel: Consolidate finding the ELF stack size with validation 2023-07-10 21:08:31 -06:00
Validation.h Kernel: Consolidate finding the ELF stack size with validation 2023-07-10 21:08:31 -06:00