Changeset e2f26002 in mainline for uspace/lib/c/arch/ia32/src/tls.c


Ignore:
Timestamp:
2016-05-17T17:15:13Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d2bb25e7
Parents:
bab0f42
Message:

symbol_get_addr() must treat thread-local variables differently than normal variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/ia32/src/tls.c

    rbab0f42 re2f26002  
    6969    *___tls_get_addr(tls_index *ti)
    7070{
    71         size_t tls_size;
    7271        uint8_t *tls;
    73 
    74         /* Calculate size of TLS block */
    75         tls_size = tls_get_size();
    76 
    77         /* The TLS block is just before TCB */
    78         tls = (uint8_t *)__tcb_get() - tls_size;
    7972
    8073#ifdef CONFIG_RTLD
    8174        if (runtime_env != NULL) {
    82                 return rtld_tls_get_addr(runtime_env, tls, ti->ti_module,
     75                return rtld_tls_get_addr(runtime_env, ti->ti_module,
    8376                    ti->ti_offset);
    8477        }
    8578#endif
     79        /* Get address of static TLS block */
     80        tls = tls_get();
    8681        return tls + ti->ti_offset;
    8782}
Note: See TracChangeset for help on using the changeset viewer.