opnsense-src/libexec/rtld-elf/amd64
Jessica Clarke 960f40b892 rtld-elf: Pass struct tcb * around rather than struct dtv **
When this code was first written we didn't have even a struct tcb, so to
make it MI a pointer to the DTV pointer in the TCB was passed around.
Now that we have a struct tcb we can simplify the code by instead
passing around a pointer to that, and the MI code can access the tcb_dtv
member wherever it happens to be in the layout. This reduces boilerplate
in all the various callers of tls_get_addr_common/slow and makes it
clearer that tls_get_addr_common/slow are operating on the TCB, rather
than obfuscating it slightly through the double pointer.

Whilst here, clarify the comments in aarch64's TLSDESC dynamic resolver,
which were using tp without clarifying what this was for (previously a
pointer to the DTV pointer, now a pointer to the TCB, which happen to be
the same thing for Variant I TLS, and in the case of AArch64 are what
TPIDR_EL0 point to directly, with no offset/bias).

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D50591
2025-05-29 17:06:49 +01:00
..
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
reloc.c rtld-elf: Pass struct tcb * around rather than struct dtv ** 2025-05-29 17:06:49 +01:00
rtld_machdep.h rtld: Add arch_digest_dynamic 2024-05-17 09:37:12 +00:00
rtld_start.S Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00