Changeset 04803bf in mainline for uspace/lib/c/rtld
- Timestamp:
- 2011-03-21T22:00:17Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 143932e3
- Parents:
- b50b5af2 (diff), 7308e84 (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. - Location:
- uspace/lib/c/rtld
- Files:
-
- 26 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/rtld/arch/ia32/src/reloc.c
rb50b5af2 r04803bf 55 55 void rel_table_process(module_t *m, elf_rel_t *rt, size_t rt_size) 56 56 { 57 inti;57 unsigned i; 58 58 59 59 size_t rt_entries; … … 62 62 unsigned rel_type; 63 63 elf_word sym_idx; 64 uint ptr_t sym_addr;64 uint32_t sym_addr; 65 65 66 66 elf_symbol_t *sym_table; … … 104 104 // DPRINTF("dest bias: 0x%x\n", dest->bias); 105 105 if (sym_def) { 106 sym_addr = symbol_get_addr(sym_def, dest); 106 sym_addr = (uint32_t) 107 symbol_get_addr(sym_def, dest); 107 108 // DPRINTF("symbol definition found, addr=0x%x\n", sym_addr); 108 109 } else { … … 111 112 continue; 112 113 } 114 } else { 115 sym_addr = 0; 116 sym_def = NULL; 113 117 } 114 118 -
uspace/lib/c/rtld/dynamic.c
rb50b5af2 r04803bf 36 36 37 37 #include <stdio.h> 38 #include <string.h>38 //#include <string.h> 39 39 40 40 #include <elf_dyn.h> -
uspace/lib/c/rtld/include/dynamic.h
rb50b5af2 r04803bf 79 79 size_t sym_ent; 80 80 81 void *init; /**< Module initialization code */82 void *fini; /**< Module cleanup code */81 void *init; /**< Module initialization code */ 82 void *fini; /**< Module cleanup code */ 83 83 84 c har *soname; /**< Library identifier */85 char *rpath; /**< Library search path list */84 const char *soname; /**< Library identifier */ 85 char *rpath; /**< Library search path list */ 86 86 87 87 bool symbolic; -
uspace/lib/c/rtld/include/module.h
rb50b5af2 r04803bf 62 62 63 63 void module_process_relocs(module_t *m); 64 module_t *module_find(c har *name);65 module_t *module_load(c har *name);64 module_t *module_find(const char *name); 65 module_t *module_load(const char *name); 66 66 void module_load_deps(module_t *m); 67 67 -
uspace/lib/c/rtld/include/symbol.h
rb50b5af2 r04803bf 39 39 #include <elf.h> 40 40 41 elf_symbol_t *symbol_bfs_find(c har *name, module_t *start, module_t **mod);42 elf_symbol_t *symbol_def_find(c har *name, module_t *origin, module_t **mod);43 uintptr_tsymbol_get_addr(elf_symbol_t *sym, module_t *m);41 elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, module_t **mod); 42 elf_symbol_t *symbol_def_find(const char *name, module_t *origin, module_t **mod); 43 void *symbol_get_addr(elf_symbol_t *sym, module_t *m); 44 44 45 45 #endif -
uspace/lib/c/rtld/module.c
rb50b5af2 r04803bf 90 90 * path components are ignored. 91 91 */ 92 module_t *module_find(c har *name)92 module_t *module_find(const char *name) 93 93 { 94 94 link_t *head = &runtime_env->modules_head; … … 96 96 link_t *cur; 97 97 module_t *m; 98 c har *p, *soname;98 const char *p, *soname; 99 99 100 100 /* … … 123 123 * Currently this trivially tries to load '/<name>'. 124 124 */ 125 module_t *module_load(c har *name)125 module_t *module_load(const char *name) 126 126 { 127 127 elf_info_t info; -
uspace/lib/c/rtld/symbol.c
rb50b5af2 r04803bf 37 37 #include <stdio.h> 38 38 #include <stdlib.h> 39 #include <string.h>39 //#include <string.h> 40 40 41 41 #include <rtld.h> … … 60 60 } 61 61 62 static elf_symbol_t *def_find_in_module(c har *name, module_t *m)62 static elf_symbol_t *def_find_in_module(const char *name, module_t *m) 63 63 { 64 64 elf_symbol_t *sym_table; … … 114 114 * that contains the symbol. 115 115 */ 116 elf_symbol_t *symbol_bfs_find(c har *name, module_t *start, module_t **mod)116 elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, module_t **mod) 117 117 { 118 118 module_t *m, *dm; … … 191 191 * that contains the symbol. 192 192 */ 193 elf_symbol_t *symbol_def_find(char *name, module_t *origin, module_t **mod) 194 { 195 module_t *m, *dm; 196 elf_symbol_t *sym, *s; 197 link_t queue_head; 198 size_t i; 193 elf_symbol_t *symbol_def_find(const char *name, module_t *origin, module_t **mod) 194 { 195 elf_symbol_t *s; 199 196 200 197 if (origin->dyn.symbolic) { … … 216 213 /* Program is dynamic -- start with program as root. */ 217 214 return symbol_bfs_find(name, runtime_env->program, mod); 218 } else { 215 } else { 219 216 /* Program is static -- start with @a origin as root. */ 220 217 return symbol_bfs_find(name, origin, mod); … … 222 219 } 223 220 224 uintptr_tsymbol_get_addr(elf_symbol_t *sym, module_t *m)221 void *symbol_get_addr(elf_symbol_t *sym, module_t *m) 225 222 { 226 223 if (sym->st_shndx == SHN_ABS) { 227 224 /* Do not add bias to absolute symbols */ 228 return sym->st_value;225 return (void *) sym->st_value; 229 226 } else { 230 return sym->st_value + m->bias;227 return (void *) (sym->st_value + m->bias); 231 228 } 232 229 }
Note:
See TracChangeset
for help on using the changeset viewer.