Changeset e2f26002 in mainline for uspace/lib/c/generic/rtld
- Timestamp:
- 2016-05-17T17:15:13Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d2bb25e7
- Parents:
- bab0f42
- Location:
- uspace/lib/c/generic/rtld
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/rtld/rtld.c
rbab0f42 re2f26002 187 187 } 188 188 189 void *rtld_tls_get_addr(rtld_t *rtld, void *tls,unsigned long mod_id,189 void *rtld_tls_get_addr(rtld_t *rtld, unsigned long mod_id, 190 190 unsigned long offset) 191 191 { 192 192 module_t *m; 193 uint8_t *tls; 193 194 194 195 m = module_by_id(rtld, mod_id); 195 196 assert(m != NULL); 196 197 198 if (!link_used(&m->imodules_link)) { 199 printf("module '%s' is not initial. aborting.\n", 200 m->dyn.soname); 201 abort(); 202 } 203 204 tls = tls_get(); 197 205 return tls + m->ioffs + offset; 198 206 } -
uspace/lib/c/generic/rtld/symbol.c
rbab0f42 re2f26002 251 251 void *symbol_get_addr(elf_symbol_t *sym, module_t *m) 252 252 { 253 if (sym->st_shndx == SHN_ABS) { 253 if (ELF_ST_TYPE(sym->st_info) == STT_TLS) { 254 return rtld_tls_get_addr(m->rtld, m->id, sym->st_value); 255 } else if (sym->st_shndx == SHN_ABS) { 254 256 /* Do not add bias to absolute symbols */ 255 257 return (void *) sym->st_value;
Note:
See TracChangeset
for help on using the changeset viewer.