44,8 → 44,6 |
#include <elf_load.h> |
#include <arch.h> |
|
runtime_env_t runtime_env; |
|
void _rtld_main(void) |
{ |
pcb_t *pcb; |
61,7 → 59,6 |
pcb = (pcb_t *)PCB_ADDRESS; |
dynamic_parse(pcb->dynamic, 0, &prog.dyn); |
prog.bias = 0; |
prog.dyn.soname = "[program]"; |
|
printf("Program requested library '%s'\n", prog.dyn.needed); |
|
73,18 → 70,11 |
|
dynamic_parse(lib_info.dynamic, 0x20000, &lib.dyn); |
lib.bias = 0x20000; |
printf("lib.bias=0x%x\n", lib.bias); |
|
runtime_env.program = &prog; |
runtime_env.libc = &lib; |
runtime_env.rtld = NULL; |
|
/* Parse program's relocation tables */ |
rel_table_process(&prog, prog.dyn.rel, prog.dyn.rel_sz); |
rel_table_process(&prog, prog.dyn.jmp_rel, prog.dyn.plt_rel_sz); |
rel_table_process(&prog, prog.dyn.rel, prog.dyn.rel_sz, &lib); |
rel_table_process(&prog, prog.dyn.jmp_rel, prog.dyn.plt_rel_sz, &lib); |
|
printf("lib.bias=0x%x\n", lib.bias); |
|
printf("Run program..\n"); |
pcb->entry(); |
} |