Changeset 0f792c28 in mainline for uspace/lib/c/generic/rtld/symbol.c
- Timestamp:
- 2016-04-12T16:59:41Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e2e9a8a
- Parents:
- 3b0f1b9a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/rtld/symbol.c
r3b0f1b9a r0f792c28 111 111 * @param name Name of the symbol to search for. 112 112 * @param start Module in which to start the search.. 113 * @param flags @c ssf_none or @c ssf_noroot to not look for the symbol 114 * in @a start 113 115 * @param mod (output) Will be filled with a pointer to the module 114 116 * that contains the symbol. 115 117 */ 116 elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, module_t **mod) 118 elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, 119 symbol_search_flags_t flags, module_t **mod) 117 120 { 118 121 module_t *m, *dm; … … 145 148 list_remove(&m->queue_link); 146 149 147 s = def_find_in_module(name, m); 148 if (s != NULL) { 149 /* Symbol found */ 150 sym = s; 151 *mod = m; 152 break; 150 /* If ssf_noroot is specified, do not look in start module */ 151 if (m != start || (flags & ssf_noroot) == 0) { 152 s = def_find_in_module(name, m); 153 if (s != NULL) { 154 /* Symbol found */ 155 sym = s; 156 *mod = m; 157 break; 158 } 153 159 } 154 160 … … 179 185 180 186 181 /** Find the definition of a symbol. .187 /** Find the definition of a symbol. 182 188 * 183 189 * By definition in System V ABI, if module origin has the flag DT_SYMBOLIC, … … 188 194 * @param name Name of the symbol to search for. 189 195 * @param origin Module in which the dependency originates. 196 * @param flags @c ssf_none or @c ssf_noroot to not look for the symbol 197 * in the executable program. 190 198 * @param mod (output) Will be filled with a pointer to the module 191 199 * that contains the symbol. 192 200 */ 193 elf_symbol_t *symbol_def_find(const char *name, module_t *origin, module_t **mod) 201 elf_symbol_t *symbol_def_find(const char *name, module_t *origin, 202 symbol_search_flags_t flags, module_t **mod) 194 203 { 195 204 elf_symbol_t *s; … … 212 221 if (runtime_env->program) { 213 222 /* Program is dynamic -- start with program as root. */ 214 return symbol_bfs_find(name, runtime_env->program, mod);223 return symbol_bfs_find(name, runtime_env->program, flags, mod); 215 224 } else { 216 225 /* Program is static -- start with @a origin as root. */ 217 return symbol_bfs_find(name, origin, mod);226 return symbol_bfs_find(name, origin, ssf_none, mod); 218 227 } 219 228 }
Note:
See TracChangeset
for help on using the changeset viewer.