Changeset c576800 in mainline


Ignore:
Timestamp:
2024-05-29T18:16:31Z (8 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
69c376b5
Parents:
b192915a
Message:

The main program's relocation must be processed after the shared libs

File:
1 edited

Legend:

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

    rb192915a rc576800  
    11/*
    2  * Copyright (c) 2008 Jiri Svoboda
     2 * Copyright (c) 2024 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    343343{
    344344        list_foreach(rtld->modules, modules_link, module_t, m) {
    345                 /* Skip rtld module, since it has already been processed */
    346                 if (m != &rtld->rtld) {
     345                /*
     346                 * Skip rtld module, since it has already been processed.
     347                 * Skip start / main program -- leave it for later
     348                 */
     349                if (m != &rtld->rtld && m != start) {
    347350                        module_process_relocs(m);
    348351                }
    349352        }
     353
     354        /*
     355         * Now that shared libraries have been processed and their variables
     356         * are thus initialized, we can process the main program,
     357         * which may contain COPY relocations that copy value from shared
     358         * library variables to instances of those variables defined
     359         * in the main program.
     360         */
     361        module_process_relocs(start);
    350362}
    351363
Note: See TracChangeset for help on using the changeset viewer.