Changeset c880421 in mainline for uspace/lib/c/generic/thread/tls.c
- Timestamp:
- 2025-01-25T21:22:04Z (11 days ago)
- Parents:
- 4ef27eb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/thread/tls.c
r4ef27eb rc880421 104 104 assert(tls_align <= PAGE_SIZE); 105 105 106 /* 107 * FIXME: the calculation of alloc_size shouldn't include the alignment 108 * of tcb_t (at least in Variant II) 109 * See https://github.com/HelenOS/helenos/pull/240/files/4ef27ebf98a0656e09889b7d00efdec03343f1aa#r1929592924 110 * (you will also need to fix _tcb_data_offset) 111 */ 112 106 113 #ifdef CONFIG_TLS_VARIANT_1 107 114 size_t alloc_size = … … 132 139 uintptr_t bias = elf_get_bias(elf); 133 140 134 /*135 * FIXME: I couldn't convince myself this is correct, but I couldn't136 * find a case where it breaks either: if the actual alloc_size is137 * bigger than the requested size (tls->p_memsz), the alignment padding138 * 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 of142 * the allocation, so if the padding has nonzero size, if think the initialization143 * data is now incorrectly offset by its size?144 *145 * Maybe a diagram helps explaining this?146 * | allocation | |147 * | paddding | data | tcb |148 * ^149 * +--- we will copy the initialization data here150 * ^151 * +--- but the data should be actually here?152 */153 154 141 /* Copy thread local data from the initialization image. */ 155 142 memcpy(data, (void *)(tls->p_vaddr + bias), tls->p_filesz);
Note:
See TracChangeset
for help on using the changeset viewer.