Ignore:
File:
1 edited

Legend:

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

    r17341d4 r4b63316  
    9191 * path components are ignored.
    9292 */
    93 module_t *module_find(rtld_t *rtld, const char *name)
     93module_t *module_find(const char *name)
    9494{
    9595        const char *p, *soname;
     
    106106
    107107        /* Traverse list of all modules. Not extremely fast, but simple */
    108         list_foreach(rtld->modules, modules_link, module_t, m) {
     108        list_foreach(runtime_env->modules, modules_link, module_t, m) {
    109109                DPRINTF("m = %p\n", m);
    110110                if (str_cmp(m->dyn.soname, soname) == 0) {
     
    122122 * Currently this trivially tries to load '/<name>'.
    123123 */
    124 module_t *module_load(rtld_t *rtld, const char *name)
    125 {
    126         elf_finfo_t info;
     124module_t *module_load(const char *name)
     125{
     126        elf_info_t info;
    127127        char name_buf[NAME_BUF_SIZE];
    128128        module_t *m;
     
    135135        }
    136136
    137         m->rtld = rtld;
    138 
    139137        if (str_size(name) > NAME_BUF_SIZE - 2) {
    140138                printf("soname too long. increase NAME_BUF_SIZE\n");
     
    147145
    148146        /* FIXME: need to real allocation of address space */
    149         m->bias = rtld->next_bias;
    150         rtld->next_bias += 0x100000;
     147        m->bias = runtime_env->next_bias;
     148        runtime_env->next_bias += 0x100000;
    151149
    152150        DPRINTF("filename:'%s'\n", name_buf);
     
    173171
    174172        /* Insert into the list of loaded modules */
    175         list_append(&m->modules_link, &rtld->modules);
     173        list_append(&m->modules_link, &runtime_env->modules);
    176174
    177175        return m;
     
    223221
    224222                        DPRINTF("%s needs %s\n", m->dyn.soname, dep_name);
    225                         dm = module_find(m->rtld, dep_name);
     223                        dm = module_find(dep_name);
    226224                        if (!dm) {
    227                                 dm = module_load(m->rtld, dep_name);
     225                                dm = module_load(dep_name);
    228226                                module_load_deps(dm);
    229227                        }
     
    243241 * @param       start   The module where to start from.
    244242 */
    245 void modules_process_relocs(rtld_t *rtld, module_t *start)
    246 {
    247         list_foreach(rtld->modules, modules_link, module_t, m) {
    248                 /* Skip rtld module, since it has already been processed */
    249                 if (m != &rtld->rtld) {
     243void modules_process_relocs(module_t *start)
     244{
     245        list_foreach(runtime_env->modules, modules_link, module_t, m) {
     246                /* Skip rtld, since it has already been processed */
     247                if (m != &runtime_env->rtld) {
    250248                        module_process_relocs(m);
    251249                }
     
    255253/** Clear BFS tags of all modules.
    256254 */
    257 void modules_untag(rtld_t *rtld)
    258 {
    259         list_foreach(rtld->modules, modules_link, module_t, m) {
     255void modules_untag(void)
     256{
     257        list_foreach(runtime_env->modules, modules_link, module_t, m) {
    260258                m->bfs_tag = false;
    261259        }
Note: See TracChangeset for help on using the changeset viewer.