Available on crate feature
tls
only.Expand description
Thread Local Storage (TLS) support.
TLS layout for x86_64
aligned --> +-------------------------+- static_tls_offset
allocation | | \
| .tdata | |
| address | | |
| grow up + - - - - - - - - - - - - + > Static TLS block
v | | | (length: static_tls_size)
| .tbss | |
| | |
+-------------------------+ |
| / PADDING / / / / / / / | /
+-------------------------+
tls_ptr -+-> self pointer (void *) | \
(tp_offset) | | |
| Custom TCB format | > Thread Control Block (TCB)
| (might be used | | (length: TCB_SIZE)
| by a libC) | |
| | /
+-------------------------+- (total length: tls_area_size)
TLS layout for AArch64 and RISC-V
+-------------------------+
| | \
| Custom TCB format | |
| (might be used | > Thread Control Block (TCB)
| by a libC) | | (length: TCB_SIZE)
| | /
tls_ptr -+-------------------------+
(tp_offset) | GAP_ABOVE_TP |
+-------------------------+- static_tls_offset
| | \
| .tdata | |
| | |
+ - - - - - - - - - - - - + > Static TLS block
| | | (length: static_tls_size)
| .tbss | |
| | /
+-------------------------+- (total length: tls_area_size)
Reference:
Structs
- The memory region for thread-local storage.