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


Ignore:
Timestamp:
2016-05-22T21:05:55Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b3364b7c
Parents:
af2254ec (diff), 3a9414e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge dynamic linking support for thread local storage.

File:
1 edited

Legend:

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

    raf2254ec rf356618  
    249249}
    250250
    251 void *symbol_get_addr(elf_symbol_t *sym, module_t *m)
    252 {
    253         if (sym->st_shndx == SHN_ABS) {
     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)
     262{
     263        if (ELF_ST_TYPE(sym->st_info) == STT_TLS) {
     264                if (tcb == NULL)
     265                        return NULL;
     266                return rtld_tls_get_addr(m->rtld, tcb, m->id, sym->st_value);
     267        } else if (sym->st_shndx == SHN_ABS) {
    254268                /* Do not add bias to absolute symbols */
    255269                return (void *) sym->st_value;
Note: See TracChangeset for help on using the changeset viewer.