Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 3676 → Rev 3677

/branches/dynload/uspace/lib/rtld/rtld.c
52,21 → 52,14
static void rtld_main(void)
{
static module_t prog;
// module_t *rtld;
 
DPRINTF("Hello, world! (from rtld)\n");
 
/*
* First we need to process dynamic sections of the two modules
* that have been already loaded, that is, of ourselves and of
* the executable program.
* First we need to process dynamic sections of the executable
* program and insert it into the module graph.
*/
 
/* rtld_dynamic and rtld->bias were filled out by the bootstrap code */
// rtld = &runtime_env.rtld;
// DPRINTF("Parse rtld .dynamic section at 0x%x\n", runtime_env.rtld_dynamic);
// dynamic_parse(runtime_env.rtld_dynamic, rtld->bias, &rtld->dyn);
 
DPRINTF("Parse program .dynamic section at 0x%x\n", __pcb->dynamic);
dynamic_parse(__pcb->dynamic, 0, &prog.dyn);
prog.bias = 0;
76,7 → 69,7
list_initialize(&runtime_env.modules_head);
list_append(&prog.modules_link, &runtime_env.modules_head);
 
/* Pointer to program module. Used as root of the dependency graph */
/* Pointer to program module. Used as root of the module graph. */
runtime_env.program = &prog;
 
/*
105,7 → 98,6
program_run(__pcb->entry, __pcb);
}
 
/** Fake main to satisfy dependency from libc */
int main(int argc, char *argv[])
{
rtld_main();
/branches/dynload/uspace/lib/libc/include/loader/pcb.h
47,25 → 47,25
* arguments, environment variables etc.
*/
typedef struct {
/** Program entry point */
/** Program entry point. */
entry_point_t entry;
 
/** Number of command-line arguments */
/** Number of command-line arguments. */
int argc;
/** Command-line arguments */
/** Command-line arguments. */
char **argv;
 
/*
* ELF-specific data
* ELF-specific data.
*/
/** Pointer to ELF dynamic section of the program */
/** Pointer to ELF dynamic section of the program. */
void *dynamic;
/** Pointer to dynamic section of the runtime linker */
void *rtld_dynamic;
/** Runtime-linker load bias */
uintptr_t rtld_bias;
} pcb_t;
 
/**
* A pointer to the program control block. Having received the PCB pointer,
* the C library startup code stores it here for later use.
*/
extern pcb_t *__pcb;
 
#endif