Changeset 32573ff in mainline for uspace/lib/c/generic/rtld/module.c
- Timestamp:
- 2016-05-02T20:58:16Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7c4b26c
- Parents:
- 6adb775f (diff), 5035ba05 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/rtld/module.c
r6adb775f r32573ff 63 63 module_process_pre_arch(m); 64 64 65 if (m->dyn.plt_rel == DT_REL) { 66 DPRINTF("table type DT_REL\n"); 67 if (m->dyn.rel != NULL) { 68 DPRINTF("non-empty\n"); 69 rel_table_process(m, m->dyn.rel, m->dyn.rel_sz); 65 /* jmp_rel table */ 66 if (m->dyn.jmp_rel != NULL) { 67 DPRINTF("jmp_rel table\n"); 68 if (m->dyn.plt_rel == DT_REL) { 69 DPRINTF("jmp_rel table type DT_REL\n"); 70 rel_table_process(m, m->dyn.jmp_rel, m->dyn.plt_rel_sz); 71 } else { 72 assert(m->dyn.plt_rel == DT_RELA); 73 DPRINTF("jmp_rel table type DT_RELA\n"); 74 rela_table_process(m, m->dyn.jmp_rel, m->dyn.plt_rel_sz); 70 75 } 71 /* FIXME: this seems wrong */72 if (m->dyn.jmp_rel != NULL) { 73 DPRINTF("table type jmp-rel\n");74 DPRINTF("non-empty\n");75 rel_table_process(m, m->dyn.jmp_rel, m->dyn.plt_rel_sz);76 }77 } else { /* (m->dyn.plt_rel == DT_RELA) */78 DPRINTF("table type DT_RELA\n"); 79 if (m->dyn.rela != NULL) {80 DPRINTF("non-empty\n");81 rela_table_process(m, m->dyn.rela, m->dyn.rela_sz);82 }76 } 77 78 /* rel table */ 79 if (m->dyn.rel != NULL) { 80 DPRINTF("rel table\n"); 81 rel_table_process(m, m->dyn.rel, m->dyn.rel_sz); 82 } 83 84 /* rela table */ 85 if (m->dyn.rela != NULL) { 86 DPRINTF("rela table\n"); 87 rela_table_process(m, m->dyn.rela, m->dyn.rela_sz); 83 88 } 84 89 … … 113 118 } 114 119 } 115 120 116 121 return NULL; /* Not found */ 117 122 } … … 123 128 * Currently this trivially tries to load '/<name>'. 124 129 */ 125 module_t *module_load(rtld_t *rtld, const char *name )130 module_t *module_load(rtld_t *rtld, const char *name, mlflags_t flags) 126 131 { 127 132 elf_finfo_t info; … … 129 134 module_t *m; 130 135 int rc; 131 136 132 137 m = calloc(1, sizeof(module_t)); 133 138 if (m == NULL) { … … 138 143 m->rtld = rtld; 139 144 m->id = rtld_get_next_id(rtld); 145 146 if ((flags & mlf_local) != 0) 147 m->local = true; 140 148 141 149 if (str_size(name) > NAME_BUF_SIZE - 2) { … … 190 198 /** Load all modules on which m (transitively) depends. 191 199 */ 192 void module_load_deps(module_t *m )200 void module_load_deps(module_t *m, mlflags_t flags) 193 201 { 194 202 elf_dyn_t *dp; … … 235 243 dm = module_find(m->rtld, dep_name); 236 244 if (!dm) { 237 dm = module_load(m->rtld, dep_name );238 module_load_deps(dm );245 dm = module_load(m->rtld, dep_name, flags); 246 module_load_deps(dm, flags); 239 247 } 240 248
Note:
See TracChangeset
for help on using the changeset viewer.