Page MenuHomeFreeBSD

libc: Consistently use uintptr_t for TLS implementation
ClosedPublic

Authored by jrtc27 on May 7 2025, 3:00 AM.
Tags
None
Referenced Files
F123421881: D50225.diff
Mon, Jul 14, 3:53 PM
Unknown Object (File)
Tue, Jul 8, 10:39 AM
Unknown Object (File)
Mon, Jul 7, 6:47 PM
Unknown Object (File)
Sat, Jul 5, 8:34 PM
Unknown Object (File)
Sat, Jul 5, 7:37 PM
Unknown Object (File)
Sat, Jul 5, 6:15 PM
Unknown Object (File)
Tue, Jul 1, 4:43 PM
Unknown Object (File)
Tue, Jul 1, 4:51 AM
Subscribers

Details

Summary

Elf_Addr is the format of addresses in the ELF file with the current
ABI's default class. This is normally the same as the format of an
address at run time, though technically exceptions do exist outside of
FreeBSD's currently-supported architectures (for example, IA-64's LP64
supports both ELFCLASS32 and ELFCLASS64 file formats; LP64 vs ILP32 is
an orthogonal EF_IA_64_ABI64 flag). On traditional architectures,
including all currently-supported FreeBSD architectures, addresses and
pointers are synonymous, but on CHERI they are not, as pointers are
capabilities that contain metadata alongside the address. In the cases
here, the quantities are run-time pointers, not addresses (and
definitely not ELF file addresses), so we should use pointer-ish types.

Note that we already use uintptr_t in struct tcb (both Variant I and
Variant II) but still use Elf_Addr in various places here.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jrtc27 requested review of this revision.May 7 2025, 3:00 AM
This revision is now accepted and ready to land.May 7 2025, 6:37 PM