Changeset d2bb25e7 in mainline for uspace/lib/c/generic/rtld/symbol.c


Ignore:
Timestamp:
2016-05-17T22:51:37Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9c07c3d
Parents:
e2f26002
Message:

Use DTVs. symbol_get_addr() should not implicitly read current thread pointer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/rtld/symbol.c

    re2f26002 rd2bb25e7  
    249249}
    250250
    251 void *symbol_get_addr(elf_symbol_t *sym, module_t *m)
     251/** Get symbol address.
     252 *
     253 * @param sym Symbol
     254 * @param m Module contaning the symbol
     255 * @param tcb TCB of the thread whose thread-local variable instance should
     256 *            be returned. If @a tcb is @c NULL then @c NULL is returned for
     257 *            thread-local variables.
     258 *
     259 * @return Symbol address
     260 */
     261void *symbol_get_addr(elf_symbol_t *sym, module_t *m, tcb_t *tcb)
    252262{
    253263        if (ELF_ST_TYPE(sym->st_info) == STT_TLS) {
    254                 return rtld_tls_get_addr(m->rtld, m->id, sym->st_value);
     264                if (tcb == NULL)
     265                        return NULL;
     266                return rtld_tls_get_addr(m->rtld, tcb, m->id, sym->st_value);
    255267        } else if (sym->st_shndx == SHN_ABS) {
    256268                /* Do not add bias to absolute symbols */
Note: See TracChangeset for help on using the changeset viewer.