Changes in uspace/lib/c/generic/rtld/symbol.c [17341d4:9d58539] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/rtld/symbol.c
r17341d4 r9d58539 39 39 40 40 #include <elf/elf.h> 41 #include <rtld/module.h>42 41 #include <rtld/rtld.h> 43 42 #include <rtld/rtld_debug.h> … … 112 111 * @param name Name of the symbol to search for. 113 112 * @param start Module in which to start the search.. 114 * @param flags @c ssf_none or @c ssf_noroot to not look for the symbol115 * in @a start116 113 * @param mod (output) Will be filled with a pointer to the module 117 114 * that contains the symbol. 118 115 */ 119 elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, 120 symbol_search_flags_t flags, module_t **mod) 116 elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, module_t **mod) 121 117 { 122 118 module_t *m, *dm; … … 133 129 134 130 /* Mark all vertices (modules) as unvisited */ 135 modules_untag( start->rtld);131 modules_untag(); 136 132 137 133 /* Insert root (the program) into the queue and tag it */ … … 149 145 list_remove(&m->queue_link); 150 146 151 /* If ssf_noroot is specified, do not look in start module */ 152 if (m != start || (flags & ssf_noroot) == 0) { 153 s = def_find_in_module(name, m); 154 if (s != NULL) { 155 /* Symbol found */ 156 sym = s; 157 *mod = m; 158 break; 159 } 147 s = def_find_in_module(name, m); 148 if (s != NULL) { 149 /* Symbol found */ 150 sym = s; 151 *mod = m; 152 break; 160 153 } 161 154 … … 186 179 187 180 188 /** Find the definition of a symbol. 181 /** Find the definition of a symbol.. 189 182 * 190 183 * By definition in System V ABI, if module origin has the flag DT_SYMBOLIC, … … 195 188 * @param name Name of the symbol to search for. 196 189 * @param origin Module in which the dependency originates. 197 * @param flags @c ssf_none or @c ssf_noroot to not look for the symbol198 * in the executable program.199 190 * @param mod (output) Will be filled with a pointer to the module 200 191 * that contains the symbol. 201 192 */ 202 elf_symbol_t *symbol_def_find(const char *name, module_t *origin, 203 symbol_search_flags_t flags, module_t **mod) 193 elf_symbol_t *symbol_def_find(const char *name, module_t *origin, module_t **mod) 204 194 { 205 195 elf_symbol_t *s; … … 220 210 /* Not DT_SYMBOLIC or no match. Now try other locations. */ 221 211 222 if ( origin->rtld->program) {212 if (runtime_env->program) { 223 213 /* Program is dynamic -- start with program as root. */ 224 return symbol_bfs_find(name, origin->rtld->program, flags, mod);214 return symbol_bfs_find(name, runtime_env->program, mod); 225 215 } else { 226 216 /* Program is static -- start with @a origin as root. */ 227 return symbol_bfs_find(name, origin, ssf_none,mod);217 return symbol_bfs_find(name, origin, mod); 228 218 } 229 219 }
Note:
See TracChangeset
for help on using the changeset viewer.