Changes in uspace/lib/c/generic/rtld/module.c [17341d4:4b63316] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/rtld/module.c
r17341d4 r4b63316 91 91 * path components are ignored. 92 92 */ 93 module_t *module_find( rtld_t *rtld,const char *name)93 module_t *module_find(const char *name) 94 94 { 95 95 const char *p, *soname; … … 106 106 107 107 /* Traverse list of all modules. Not extremely fast, but simple */ 108 list_foreach(r tld->modules, modules_link, module_t, m) {108 list_foreach(runtime_env->modules, modules_link, module_t, m) { 109 109 DPRINTF("m = %p\n", m); 110 110 if (str_cmp(m->dyn.soname, soname) == 0) { … … 122 122 * Currently this trivially tries to load '/<name>'. 123 123 */ 124 module_t *module_load( rtld_t *rtld,const char *name)125 { 126 elf_ finfo_t info;124 module_t *module_load(const char *name) 125 { 126 elf_info_t info; 127 127 char name_buf[NAME_BUF_SIZE]; 128 128 module_t *m; … … 135 135 } 136 136 137 m->rtld = rtld;138 139 137 if (str_size(name) > NAME_BUF_SIZE - 2) { 140 138 printf("soname too long. increase NAME_BUF_SIZE\n"); … … 147 145 148 146 /* FIXME: need to real allocation of address space */ 149 m->bias = r tld->next_bias;150 r tld->next_bias += 0x100000;147 m->bias = runtime_env->next_bias; 148 runtime_env->next_bias += 0x100000; 151 149 152 150 DPRINTF("filename:'%s'\n", name_buf); … … 173 171 174 172 /* Insert into the list of loaded modules */ 175 list_append(&m->modules_link, &r tld->modules);173 list_append(&m->modules_link, &runtime_env->modules); 176 174 177 175 return m; … … 223 221 224 222 DPRINTF("%s needs %s\n", m->dyn.soname, dep_name); 225 dm = module_find( m->rtld,dep_name);223 dm = module_find(dep_name); 226 224 if (!dm) { 227 dm = module_load( m->rtld,dep_name);225 dm = module_load(dep_name); 228 226 module_load_deps(dm); 229 227 } … … 243 241 * @param start The module where to start from. 244 242 */ 245 void modules_process_relocs( rtld_t *rtld,module_t *start)246 { 247 list_foreach(r tld->modules, modules_link, module_t, m) {248 /* Skip rtld module, since it has already been processed */249 if (m != &r tld->rtld) {243 void 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) { 250 248 module_process_relocs(m); 251 249 } … … 255 253 /** Clear BFS tags of all modules. 256 254 */ 257 void modules_untag( rtld_t *rtld)258 { 259 list_foreach(r tld->modules, modules_link, module_t, m) {255 void modules_untag(void) 256 { 257 list_foreach(runtime_env->modules, modules_link, module_t, m) { 260 258 m->bfs_tag = false; 261 259 }
Note:
See TracChangeset
for help on using the changeset viewer.