Changeset 544c5b4 in mainline
- Timestamp:
- 2025-01-25T16:25:39Z (10 days ago)
- Children:
- 4ef27eb
- Parents:
- 328b89f
- git-author:
- Matěj Volf <git@…> (2025-01-24 23:59:36)
- git-committer:
- Matěj Volf <git@…> (2025-01-25 16:25:39)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/thread/tls.c
r328b89f r544c5b4 85 85 static tcb_t *tls_make_generic(const void *elf, void *(*alloc)(size_t, size_t)) 86 86 { 87 /* 88 * See also rtld/module.c -> modules_process_tls(), where we have less 89 * messy code for the dynamic-linking version of this. 90 */ 87 91 assert(!elf_get_phdr(elf, PT_DYNAMIC)); 88 92 #ifdef CONFIG_RTLD … … 128 132 uintptr_t bias = elf_get_bias(elf); 129 133 134 /* 135 * FIXME: I couldn't convince myself this is correct, but I couldn't 136 * find a case where it breaks either: if the actual alloc_size is 137 * bigger than the requested size (tls->p_memsz), the alignment padding 138 * will be placed at the beginning (because TLS is (at least sometimes?) 139 * indexed with negative offsets from the TCB pointer). 140 * 141 * Now we will copy the initialization data to a position at the start of 142 * the allocation, so if the padding has nonzero size, if think the initialization 143 * data is now incorrectly offset by its size? 144 */ 145 130 146 /* Copy thread local data from the initialization image. */ 131 147 memcpy(data, (void *)(tls->p_vaddr + bias), tls->p_filesz);
Note:
See TracChangeset
for help on using the changeset viewer.