Changeset 7465910 in mainline for uspace/lib/c/generic/rtld/module.c


Ignore:
Timestamp:
2018-05-01T17:46:56Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Parents:
9e5cc73
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-05-01 17:31:49)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-05-01 17:46:56)
Message:

Make some effort to allocate the memory area for shared objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/rtld/module.c

    r9e5cc73 r7465910  
    202202        str_cpy(name_buf + 5, NAME_BUF_SIZE - 5, name);
    203203
    204         /* FIXME: need to real allocation of address space */
    205         m->bias = rtld->next_bias;
    206         rtld->next_bias += 0x100000;
    207204
    208205        DPRINTF("filename:'%s'\n", name_buf);
    209         DPRINTF("load '%s' at 0x%zx\n", name_buf, m->bias);
    210 
    211         rc = elf_load_file_name(name_buf, m->bias, ELDF_RW, &info);
     206
     207        rc = elf_load_file_name(name_buf, ELDF_RW, &info);
    212208        if (rc != EE_OK) {
    213209                printf("Failed to load '%s'\n", name_buf);
    214210                exit(1);
    215211        }
     212
     213        m->bias = elf_get_bias(info.base);
     214
     215        DPRINTF("loaded '%s' at 0x%zx\n", name_buf, m->bias);
    216216
    217217        if (info.dynamic == NULL) {
Note: See TracChangeset for help on using the changeset viewer.