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