Page MenuHomeFreeBSD

rtld-elf/riscv: Don't allocate static TLS for dynamic TLS
ClosedPublic

Authored by jrtc27 on May 28 2025, 1:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 3, 10:39 AM
Unknown Object (File)
Aug 23 2025, 11:11 AM
Unknown Object (File)
Aug 16 2025, 2:05 AM
Unknown Object (File)
Jul 29 2025, 7:56 AM
Unknown Object (File)
Jul 29 2025, 2:10 AM
Unknown Object (File)
Jul 19 2025, 11:34 AM
Unknown Object (File)
Jul 17 2025, 12:09 PM
Unknown Object (File)
Jul 16 2025, 2:29 AM
Subscribers

Details

Summary

Provided you don't run out of extra static TLS space this should work,
but it's wholly unnecessary and not how things are supposed to be done.

Fixes: 4b1859c0e943 ("Add support for RISC-V architecture.")
MFC after: 1 week

Diff Detail

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

Event Timeline

Indeed this is not how things are supposed to work. At least on x86, this is how things are. There are vendor libs linked with static TLS model, which happens to be dynamically loaded, and people really want that to work. The libs cannot be recompiled (they come from nvidia).

If you want to keep risc-v "pure", it is up to you.

This revision is now accepted and ready to land.May 28 2025, 4:07 PM
In D50563#1154663, @kib wrote:

Indeed this is not how things are supposed to work. At least on x86, this is how things are. There are vendor libs linked with static TLS model, which happens to be dynamically loaded, and people really want that to work. The libs cannot be recompiled (they come from nvidia).

If you want to keep risc-v "pure", it is up to you.

It'd be nice if we hadn't gone down that road, but every arch seems to be supporting the extra static TLS space, RISC-V included, so I'm leaving that in for TPREL64, it's not that big a deal (though the infrastructure to support distributing static TLS out to other threads is quite horrifying)