Changeset 153c7a29 in mainline for uspace/lib/c/generic/rtld/rtld.c


Ignore:
Timestamp:
2016-05-22T17:46:10Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0dc2fec
Parents:
2112a79
Message:

Since dlopen() sets up runtime_env, we would no longer use the static TLS. Thus set up runtime_env right away and convert static TLS to dynamic TLS.

File:
1 edited

Legend:

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

    r2112a79 r153c7a29  
    4545
    4646/** Initialize the runtime linker for use in a statically-linked executable. */
    47 void rtld_init_static(void)
    48 {
     47int rtld_init_static(void)
     48{
     49        int rc;
     50
    4951        runtime_env = &rt_env_static;
    5052        list_initialize(&runtime_env->modules);
     
    5254        runtime_env->next_bias = 0x2000000;
    5355        runtime_env->program = NULL;
     56        runtime_env->next_id = 1;
     57
     58        rc = module_create_static_exec(runtime_env, NULL);
     59        if (rc != EOK)
     60                return rc;
     61
     62        modules_process_tls(runtime_env);
     63
     64        return EOK;
    5465}
    5566
     
    98109        prog->tls_align = p_info->tls.tls_align;
    99110
    100         printf("prog tdata at %p size %zu, tbss size %zu\n",
     111        DPRINTF("prog tdata at %p size %zu, tbss size %zu\n",
    101112            prog->tdata, prog->tdata_size, prog->tbss_size);
    102113
Note: See TracChangeset for help on using the changeset viewer.