Merge "ELS TLS documentation: s/module/module_id/."

This commit is contained in:
Elliott Hughes 2023-04-03 20:47:59 +00:00 committed by Gerrit Code Review
commit 4b27a21b6a
2 changed files with 5 additions and 5 deletions

View file

@ -101,9 +101,9 @@ char* get_tls_var() {
`R_TLS_DTPOFF` is a dynamic relocation to the offset of `tls_var` within its module's `PT_TLS`
segment.
`__tls_get_addr` looks up `TlsIndex::module`'s entry in the DTV and adds `TlsIndex::offset` to the
module's TLS block. Before it can do this, it ensures that the module's TLS block is allocated. A
simple approach is to allocate memory lazily:
`__tls_get_addr` looks up `TlsIndex::module_id`'s entry in the DTV and adds `TlsIndex::offset` to
the module's TLS block. Before it can do this, it ensures that the module's TLS block is allocated.
A simple approach is to allocate memory lazily:
1. If the current thread's DTV generation count is less than the current global TLS generation, then
`__tls_get_addr` may reallocate the DTV or free blocks for unloaded modules.

View file

@ -58,9 +58,9 @@ ENTRY_PRIVATE(tlsdesc_resolver_dynamic)
cmp x21, x22
b.lo .fallback
ldr x21, [x0, #8] // TlsIndex::module
ldr x21, [x0, #8] // TlsIndex::module_id
ldr x22, [x0, #16] // TlsIndex::offset
ldr x21, [x20, x21, lsl #3] // TlsDtv::modules[module]
ldr x21, [x20, x21, lsl #3] // TlsDtv::modules[module_id]
cbz x21, .fallback
add x0, x21, x22
sub x0, x0, x19