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


Ignore:
Timestamp:
2011-07-29T14:50:22Z (13 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b6759f4
Parents:
6c69d19 (diff), 7ae249d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge libposix.

File:
1 edited

Legend:

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

    r6c69d19 r00c2de63  
    3535 */
    3636
     37#include <adt/list.h>
     38#include <elf/elf_load.h>
     39#include <fcntl.h>
     40#include <loader/pcb.h>
    3741#include <stdio.h>
    3842#include <stdlib.h>
    3943#include <unistd.h>
    40 #include <fcntl.h>
    41 #include <adt/list.h>
    42 #include <loader/pcb.h>
    4344
    4445#include <rtld/rtld.h>
     
    4748#include <rtld/rtld_arch.h>
    4849#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;
    9895        module_t *m;
    9996        const char *p, *soname;
     
    110107
    111108        /* Traverse list of all modules. Not extremely fast, but simple */
    112         DPRINTF("head = %p\n", head);
    113         for (cur = head->next; cur != head; cur = cur->next) {
     109        list_foreach(runtime_env->modules, cur) {
    114110                DPRINTF("cur = %p\n", cur);
    115111                m = list_get_instance(cur, module_t, modules_link);
     
    177173
    178174        /* Insert into the list of loaded modules */
    179         list_append(&m->modules_link, &runtime_env->modules_head);
     175        list_append(&m->modules_link, &runtime_env->modules);
    180176
    181177        return m;
     
    249245void modules_process_relocs(module_t *start)
    250246{
    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) {
     247        module_t *m;
     248
     249        list_foreach(runtime_env->modules, cur) {
    257250                m = list_get_instance(cur, module_t, modules_link);
    258251
     
    268261void modules_untag(void)
    269262{
    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) {
     263        module_t *m;
     264
     265        list_foreach(runtime_env->modules, cur) {
    276266                m = list_get_instance(cur, module_t, modules_link);
    277267                m->bfs_tag = false;
Note: See TracChangeset for help on using the changeset viewer.