Subversion Repositories HelenOS

Rev

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

Rev 3690 Rev 3869
Line 56... Line 56...
56
    DPRINTF("module_process_relocs('%s')\n", m->dyn.soname);
56
    DPRINTF("module_process_relocs('%s')\n", m->dyn.soname);
57
 
57
 
58
    /* Do not relocate twice. */
58
    /* Do not relocate twice. */
59
    if (m->relocated) return;
59
    if (m->relocated) return;
60
 
60
 
-
 
61
    module_process_pre_arch(m);
-
 
62
 
61
    if (m->dyn.plt_rel == DT_REL) {
63
    if (m->dyn.plt_rel == DT_REL) {
-
 
64
        DPRINTF("table type DT_REL\n");
62
        if (m->dyn.rel != NULL)
65
        if (m->dyn.rel != NULL) {
-
 
66
            DPRINTF("non-empty\n");
63
            rel_table_process(m, m->dyn.rel, m->dyn.rel_sz);
67
            rel_table_process(m, m->dyn.rel, m->dyn.rel_sz);
-
 
68
        }
64
        /* FIXME: this seems wrong */
69
        /* FIXME: this seems wrong */
65
        if (m->dyn.jmp_rel != NULL)
70
        if (m->dyn.jmp_rel != NULL) {
-
 
71
        DPRINTF("table type jmp-rel\n");
-
 
72
            DPRINTF("non-empty\n");
66
            rel_table_process(m, m->dyn.jmp_rel, m->dyn.plt_rel_sz);
73
            rel_table_process(m, m->dyn.jmp_rel, m->dyn.plt_rel_sz);
-
 
74
        }
67
    } else { /* (m->dyn.plt_rel == DT_RELA) */
75
    } else { /* (m->dyn.plt_rel == DT_RELA) */
68
        DPRINTF("table type DT_RELA\n");
76
        DPRINTF("table type DT_RELA\n");
69
        if (m->dyn.rela != NULL) {
77
        if (m->dyn.rela != NULL) {
70
            DPRINTF("non-empty\n");
78
            DPRINTF("non-empty\n");
71
            rela_table_process(m, m->dyn.rela, m->dyn.rela_sz);
79
            rela_table_process(m, m->dyn.rela, m->dyn.rela_sz);
Line 140... Line 148...
140
    /* FIXME: need to real allocation of address space */
148
    /* FIXME: need to real allocation of address space */
141
    m->bias = runtime_env->next_bias;
149
    m->bias = runtime_env->next_bias;
142
    runtime_env->next_bias += 0x100000;
150
    runtime_env->next_bias += 0x100000;
143
 
151
 
144
    DPRINTF("filename:'%s'\n", name_buf);
152
    DPRINTF("filename:'%s'\n", name_buf);
-
 
153
    printf("load '%s' at 0x%x\n", name_buf, m->bias);
145
 
154
 
146
    rc = elf_load_file(name_buf, m->bias, ELDF_RW, &info);
155
    rc = elf_load_file(name_buf, m->bias, ELDF_RW, &info);
147
    if (rc != EE_OK) {
156
    if (rc != EE_OK) {
148
        printf("Failed to load '%s'\n", name_buf);
157
        printf("Failed to load '%s'\n", name_buf);
149
        exit(1);
158
        exit(1);