Changeset 153c7a29 in mainline for uspace/lib/c/generic/libc.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/libc.c

    r2112a79 r153c7a29  
    4141 */
    4242
     43#include <errno.h>
    4344#include <libc.h>
    4445#include <stdlib.h>
     
    6566void __main(void *pcb_ptr)
    6667{
     68        /* Initialize user task run-time environment */
     69        __malloc_init();
     70       
    6771        /* Save the PCB pointer */
    6872        __pcb = (pcb_t *) pcb_ptr;
     
    7175        if (__pcb != NULL && __pcb->rtld_runtime != NULL) {
    7276                runtime_env = (rtld_t *) __pcb->rtld_runtime;
     77        } else {
     78                if (rtld_init_static() != EOK)
     79                        abort();
    7380        }
    7481#endif
    75         /* Initialize user task run-time environment */
    76         __malloc_init();
    7782       
    7883        fibril_t *fibril = fibril_setup();
Note: See TracChangeset for help on using the changeset viewer.