Ignore:
File:
1 edited

Legend:

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

    rbfdb5af1 r8a1fb09  
    3535 */
    3636
    37 #include <adt/list.h>
    38 #include <elf/elf_load.h>
    39 #include <fcntl.h>
    40 #include <loader/pcb.h>
    4137#include <stdio.h>
    4238#include <stdlib.h>
    4339#include <unistd.h>
     40#include <fcntl.h>
     41#include <adt/list.h>
     42#include <loader/pcb.h>
    4443
    4544#include <rtld/rtld.h>
     
    4847#include <rtld/rtld_arch.h>
    4948#include <rtld/module.h>
     49#include <elf_load.h>
    5050
    5151/** (Eagerly) process all relocation tables in a module.
     
    9393module_t *module_find(const char *name)
    9494{
     95        link_t *head = &runtime_env->modules_head;
     96
     97        link_t *cur;
    9598        module_t *m;
    9699        const char *p, *soname;
     
    107110
    108111        /* Traverse list of all modules. Not extremely fast, but simple */
    109         list_foreach(runtime_env->modules, cur) {
     112        DPRINTF("head = %p\n", head);
     113        for (cur = head->next; cur != head; cur = cur->next) {
    110114                DPRINTF("cur = %p\n", cur);
    111115                m = list_get_instance(cur, module_t, modules_link);
     
    173177
    174178        /* Insert into the list of loaded modules */
    175         list_append(&m->modules_link, &runtime_env->modules);
     179        list_append(&m->modules_link, &runtime_env->modules_head);
    176180
    177181        return m;
     
    245249void modules_process_relocs(module_t *start)
    246250{
    247         module_t *m;
    248 
    249         list_foreach(runtime_env->modules, cur) {
     251        link_t *head = &runtime_env->modules_head;
     252
     253        link_t *cur;
     254        module_t *m;
     255
     256        for (cur = head->next; cur != head; cur = cur->next) {
    250257                m = list_get_instance(cur, module_t, modules_link);
    251258
     
    261268void modules_untag(void)
    262269{
    263         module_t *m;
    264 
    265         list_foreach(runtime_env->modules, cur) {
     270        link_t *head = &runtime_env->modules_head;
     271
     272        link_t *cur;
     273        module_t *m;
     274
     275        for (cur = head->next; cur != head; cur = cur->next) {
    266276                m = list_get_instance(cur, module_t, modules_link);
    267277                m->bfs_tag = false;
Note: See TracChangeset for help on using the changeset viewer.