Page MenuHomeFreeBSD

rtld-elf: Use variables more consistent with Variant I for Variant II TLS
ClosedPublic

Authored by jrtc27 on May 7 2025, 3:06 AM.
Tags
None
Referenced Files
F122015893: D50232.id155030.diff
Tue, Jul 1, 11:41 AM
F121970460: D50232.id.diff
Tue, Jul 1, 2:11 AM
F121914131: D50232.diff
Mon, Jun 30, 2:49 PM
Unknown Object (File)
Sat, Jun 28, 7:23 AM
Unknown Object (File)
Fri, Jun 27, 6:44 PM
Unknown Object (File)
Wed, Jun 25, 8:00 PM
Unknown Object (File)
Fri, Jun 20, 2:28 PM
Unknown Object (File)
Thu, Jun 19, 5:35 AM
Subscribers

Details

Summary

Firstly, the second argument to allocate_tls is the old TCB (versus
oldtls, which has less of a clear meaning), so rename it to oldtcb like
Variant I.

Secondly, segbase and oldsegbase are oriented towards what ends up in
the segment registers, but that's not the main concern here, and those
don't convey what they actually point to. Instead, rename segbase to tcb
and change it to a uintptr_t **, and remove oldsegbase as it's always
equal to oldtcb, again both matching Variant I.

Thirdly, rename tls to tls_block, again both matching Variant I.

Finally, similarly rename tls to tcb in free_tls, and oldtls to oldtcb
in the common _rtld_allocate_tls.

Diff Detail

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