Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/rtld/symbol.c

    r17341d4 r9d58539  
    3939
    4040#include <elf/elf.h>
    41 #include <rtld/module.h>
    4241#include <rtld/rtld.h>
    4342#include <rtld/rtld_debug.h>
     
    112111 * @param name          Name of the symbol to search for.
    113112 * @param start         Module in which to start the search..
    114  * @param flags         @c ssf_none or @c ssf_noroot to not look for the symbol
    115  *                      in @a start
    116113 * @param mod           (output) Will be filled with a pointer to the module
    117114 *                      that contains the symbol.
    118115 */
    119 elf_symbol_t *symbol_bfs_find(const char *name, module_t *start,
    120     symbol_search_flags_t flags, module_t **mod)
     116elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, module_t **mod)
    121117{
    122118        module_t *m, *dm;
     
    133129
    134130        /* Mark all vertices (modules) as unvisited */ 
    135         modules_untag(start->rtld);
     131        modules_untag();
    136132
    137133        /* Insert root (the program) into the queue and tag it */
     
    149145                list_remove(&m->queue_link);
    150146
    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;
    160153                }
    161154
     
    186179
    187180
    188 /** Find the definition of a symbol.
     181/** Find the definition of a symbol..
    189182 *
    190183 * By definition in System V ABI, if module origin has the flag DT_SYMBOLIC,
     
    195188 * @param name          Name of the symbol to search for.
    196189 * @param origin        Module in which the dependency originates.
    197  * @param flags         @c ssf_none or @c ssf_noroot to not look for the symbol
    198  *                      in the executable program.
    199190 * @param mod           (output) Will be filled with a pointer to the module
    200191 *                      that contains the symbol.
    201192 */
    202 elf_symbol_t *symbol_def_find(const char *name, module_t *origin,
    203     symbol_search_flags_t flags, module_t **mod)
     193elf_symbol_t *symbol_def_find(const char *name, module_t *origin, module_t **mod)
    204194{
    205195        elf_symbol_t *s;
     
    220210        /* Not DT_SYMBOLIC or no match. Now try other locations. */
    221211
    222         if (origin->rtld->program) {
     212        if (runtime_env->program) {
    223213                /* 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);
    225215        } else {
    226216                /* 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);
    228218        }
    229219}
Note: See TracChangeset for help on using the changeset viewer.