47,10 → 47,14 |
|
void program_run(void *entry, pcb_t *pcb); |
|
runtime_env_t dload_re; |
|
int main(int argc, char *argv[]) |
{ |
static module_t prog; |
|
runtime_env = &dload_re; |
|
DPRINTF("Hello, world! (from dload)\n"); |
if (__pcb->dynamic == NULL) { |
printf("This is the dynamic loader. It is not supposed " |
69,11 → 73,11 |
prog.dyn.soname = "[program]"; |
|
/* Initialize list of loaded modules */ |
list_initialize(&runtime_env.modules_head); |
list_append(&prog.modules_link, &runtime_env.modules_head); |
list_initialize(&runtime_env->modules_head); |
list_append(&prog.modules_link, &runtime_env->modules_head); |
|
/* Pointer to program module. Used as root of the module graph. */ |
runtime_env.program = &prog; |
runtime_env->program = &prog; |
|
/* |
* Now we can continue with loading all other modules. |
90,6 → 94,9 |
DPRINTF("Relocate all modules\n"); |
modules_process_relocs(); |
|
/* Pass runtime evironment pointer through PCB. */ |
__pcb->rtld_runtime = (void *) runtime_env; |
|
/* |
* Finally, run the main program. |
*/ |