rtld


Files

file  dlfcn.c
file  dlfcn.h
 UNIX-like dynamic linker interface.
file  dynamic.c
file  module.c
file  rtld.c
file  symbol.c

Defines

#define NAME_BUF_SIZE   64

Functions

static elf_symbol_t * def_find_in_module (const char *name, module_t *m)
void * dlopen (const char *path, int flag)
void * dlsym (void *mod, const char *sym_name)
void dynamic_parse (elf_dyn_t *dyn_ptr, size_t bias, dyn_info_t *info)
static elf_word elf_hash (const unsigned char *name)
module_tmodule_find (const char *name)
 Find module structure by soname/pathname.
module_tmodule_load (const char *name)
 Load a module.
void module_load_deps (module_t *m)
 Load all modules on which m (transitively) depends.
void module_process_relocs (module_t *m)
 (Eagerly) process all relocation tables in a module.
void modules_process_relocs (module_t *start)
 Process relocations in modules.
void modules_untag (void)
 Clear BFS tags of all modules.
void rtld_init_static (void)
 Initialize the loder for use in a statically-linked binary.
elf_symbol_t * symbol_bfs_find (const char *name, module_t *start, module_t **mod)
 Find the definition of a symbol in a module and its deps.
elf_symbol_t * symbol_def_find (const char *name, module_t *origin, module_t **mod)
 Find the definition of a symbol.
void * symbol_get_addr (elf_symbol_t *sym, module_t *m)

Variables

static runtime_env_t rt_env_static
runtime_env_truntime_env

Function Documentation

module_t* module_find ( const char *  name  ) 

Find module structure by soname/pathname.

Used primarily to see if a module has already been loaded. Modules are compared according to their soname, i.e. possible path components are ignored.

Definition at line 93 of file module.c.

module_t* module_load ( const char *  name  ) 

Load a module.

Currently this trivially tries to load '/<name>'.

Definition at line 130 of file module.c.

void module_process_relocs ( module_t m  ) 

(Eagerly) process all relocation tables in a module.

Currently works as if LD_BIND_NOW was specified.

Definition at line 55 of file module.c.

void modules_process_relocs ( module_t start  ) 

Process relocations in modules.

Processes relocations in start and all its dependencies. Modules that have already been relocated are unaffected.

Parameters:
start The module where to start from.

Definition at line 249 of file module.c.

elf_symbol_t* symbol_bfs_find ( const char *  name,
module_t start,
module_t **  mod 
)

Find the definition of a symbol in a module and its deps.

Search the module dependency graph is breadth-first, beginning from the module start. Thus, and all its dependencies get searched.

Parameters:
name Name of the symbol to search for.
start Module in which to start the search..
mod (output) Will be filled with a pointer to the module that contains the symbol.

Definition at line 116 of file symbol.c.

elf_symbol_t* symbol_def_find ( const char *  name,
module_t origin,
module_t **  mod 
)

Find the definition of a symbol.

By definition in System V ABI, if module origin has the flag DT_SYMBOLIC, origin is searched first. Otherwise, or if the symbol hasn't been found, the module dependency graph is searched breadth-first, beginning from the executable program.

Parameters:
name Name of the symbol to search for.
origin Module in which the dependency originates.
mod (output) Will be filled with a pointer to the module that contains the symbol.

Definition at line 193 of file symbol.c.


Generated on Thu Jun 2 07:45:57 2011 for HelenOS/USB by  doxygen 1.4.7