Page MenuHomeFreeBSD

libc, libthr: Ditch MD __pthread_distribute_static_tls helpers
ClosedPublic

Authored by jrtc27 on May 28 2025, 10:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 3, 5:11 PM
Unknown Object (File)
Fri, Oct 3, 10:39 AM
Unknown Object (File)
Thu, Oct 2, 10:40 PM
Unknown Object (File)
Thu, Sep 25, 6:57 PM
Unknown Object (File)
Sep 8 2025, 11:40 AM
Unknown Object (File)
Aug 18 2025, 9:39 PM
Unknown Object (File)
Aug 12 2025, 2:23 PM
Unknown Object (File)
Aug 8 2025, 9:01 PM
Subscribers

Details

Summary

_libc_get_static_tls_base() is just _tcb_get() followed by adding (for
Variant I) or subtracting (for Variant II) the offset, so just inline
that as the implementation (like we do in rtld-elf) rather than having
another copy (or equivalent) of _tcb_get()'s assembly.

_get_static_tls_base() doesn't even have any MD assembly as it's
reading thr->tcb, the only difference is whether to add or subtract, so
again just inline that.

Whilst here add some missing blank lines to comply with style(9) for
elf_utils.c's includes, and use a pointer type rather than uintptr_t to
reduce the need to cast, as is done in rtld-elf.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 64523
Build 61407: arc lint + arc unit