Subversion Repositories HelenOS

Rev

Rev 3401 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3401 Rev 3552
Line 50... Line 50...
50
void program_run(void *entry, pcb_t *pcb);
50
void program_run(void *entry, pcb_t *pcb);
51
 
51
 
52
void _rtld_main(void)
52
void _rtld_main(void)
53
{
53
{
54
    static module_t prog;
54
    static module_t prog;
55
    module_t *rtld;
55
//  module_t *rtld;
56
 
56
 
57
    printf("Hello, world! (from rtld)\n");
57
    printf("Hello, world! (from rtld)\n");
58
 
58
 
59
    /*
59
    /*
60
     * First we need to process dynamic sections of the two modules
60
     * First we need to process dynamic sections of the two modules
61
     * that have been already loaded, that is, of ourselves and of
61
     * that have been already loaded, that is, of ourselves and of
62
     * the executable program.
62
     * the executable program.
63
     */
63
     */
64
 
64
 
65
    /* rtld_dynamic and rtld->bias were filled out by the bootstrap code */
65
    /* rtld_dynamic and rtld->bias were filled out by the bootstrap code */
66
    rtld = &runtime_env.rtld;
66
//  rtld = &runtime_env.rtld;
67
    printf("Parse rtld .dynamic section at 0x%x\n", runtime_env.rtld_dynamic);
67
//  printf("Parse rtld .dynamic section at 0x%x\n", runtime_env.rtld_dynamic);
68
    dynamic_parse(runtime_env.rtld_dynamic, rtld->bias, &rtld->dyn);
68
//  dynamic_parse(runtime_env.rtld_dynamic, rtld->bias, &rtld->dyn);
69
 
69
 
70
    printf("Parse program .dynamic section at 0x%x\n", __pcb->dynamic);
70
    printf("Parse program .dynamic section at 0x%x\n", __pcb->dynamic);
71
    dynamic_parse(__pcb->dynamic, 0, &prog.dyn);
71
    dynamic_parse(__pcb->dynamic, 0, &prog.dyn);
72
    prog.bias = 0;
72
    prog.bias = 0;
73
    prog.dyn.soname = "[program]";
73
    prog.dyn.soname = "[program]";
74
 
74
 
75
    /* Initialize list of loaded modules */
75
    /* Initialize list of loaded modules */
76
    list_initialize(&runtime_env.modules_head);
76
    list_initialize(&runtime_env.modules_head);
77
    list_append(&prog.modules_link, &runtime_env.modules_head);
77
    list_append(&prog.modules_link, &runtime_env.modules_head);
78
    list_append(&rtld->modules_link, &runtime_env.modules_head);
78
//  list_append(&rtld->modules_link, &runtime_env.modules_head);
79
 
79
 
80
    /* Pointer to program module. Used as root of the dependency graph */
80
    /* Pointer to program module. Used as root of the dependency graph */
81
    runtime_env.program = &prog;
81
    runtime_env.program = &prog;
82
 
82
 
83
    /*
83
    /*