1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-10-16 05:12:23 +00:00
serenity/Userland/Libraries/LibC/sys
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 Kernel+LibC: Modify aarch64's __mcontext to store registers in an array 2023-04-06 21:19:58 +03:00
auxv.cpp LibC+LibELF: Move getauxval and AT_* flags to sys/auxv.h 2021-10-28 11:24:36 +02:00
auxv.h Kernel+Libraries: Move defines and types from sys/auxv.h to Kernel/API 2023-01-21 10:43:59 -07:00
cdefs.h LibC: Define offsetof in stddef.h instead of sys/cdefs.h 2022-02-28 20:28:01 -08:00
file.cpp LibC: Support blocking flock() 2022-07-21 16:39:22 +02:00
file.h LibC: Implement flock(2) using fcntl's F_SETLK 2021-07-20 17:44:30 +04:30
internals.h LibC+LibELF: Support loading shared libraries compiled with dynamic TLS 2023-08-18 16:20:13 +02:00
ioctl.h Kernel+Userland: Move LibC/sys/ioctl_numbers to Kernel/API/Ioctl.h 2023-01-21 10:43:59 -07:00
mman.cpp LibC: Mark a bunch of functions as cancellation points 2022-07-22 10:07:15 -07:00
mman.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
param.h LibC: Add MIN, MAX and howmany macros to sys/param.h 2022-04-29 22:01:27 +02:00
poll.h LibC: Add <sys/poll.h> as an alias for <poll.h> 2021-08-22 10:29:06 +02:00
prctl.cpp LibC: Make prctl() a varargs function 2022-03-29 09:10:34 -07:00
prctl.h Kernel+Userland: Move prctl numbers header file to Kernel/API directory 2023-02-24 20:35:45 +01:00
ptrace.cpp LibCore: Implement new ptrace_peekbuf wrapper for PT_PEEKBUF syscall 2021-12-05 22:59:09 +01:00
ptrace.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
resource.h LibC: Add most of the "header may make visible" dependencies from POSIX 2023-07-19 00:19:35 -06:00
select.cpp LibC: Mark a bunch of functions as cancellation points 2022-07-22 10:07:15 -07:00
select.h LibC: Fix struct declaration visibility 2023-07-29 16:51:58 -06:00
socket.cpp LibC: Mark a bunch of functions as cancellation points 2022-07-22 10:07:15 -07:00
socket.h LibC: Add most of the "header may make visible" dependencies from POSIX 2023-07-19 00:19:35 -06:00
stat.h Kernel+LibC+LibCore: Implement mkdirat(2) 2022-12-11 19:55:37 -07:00
statvfs.cpp Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
statvfs.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
sysmacros.h Everywhere: Add serenity_dev_{makedev,major,minor} 2022-01-09 00:58:44 +01:00
time.h LibC: Define time* macros before definitions 2023-08-09 05:40:39 +02:00
times.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
ttydefaults.h Kernel: Move TYPEDEF_* TTY macros to API/ttydefaults.h file 2023-03-01 19:36:53 -07:00
types.h Kernel+LibC: Share definitions in fcntl.h and sys/types.h 2021-08-14 19:58:11 +02:00
uio.cpp Kernel+LibC: Pass 64-bit integers in syscalls by value 2023-08-12 01:14:26 +02:00
uio.h Kernel+LibC+Tests: Implement pwritev(2) 2022-12-11 19:55:37 -07:00
un.h Kernel+LibC: Share definitions for sys/socket.h and sys/un.h 2021-08-14 19:58:11 +02:00
utsname.h LibC: Add missing sys/cdefs.h include 2022-08-23 19:07:12 +01:00
wait.cpp LibC: Mark a bunch of functions as cancellation points 2022-07-22 10:07:15 -07:00
wait.h LibC: Add most of the "header may make visible" dependencies from POSIX 2023-07-19 00:19:35 -06:00