Ignore:
File:
1 edited

Legend:

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

    rb27ae65a rffccdff0  
    11/*
    2  * Copyright (c) 2024 Jiri Svoboda
     2 * Copyright (c) 2008 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    343343{
    344344        list_foreach(rtld->modules, modules_link, module_t, m) {
    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) {
     345                /* Skip rtld module, since it has already been processed */
     346                if (m != &rtld->rtld) {
    350347                        module_process_relocs(m);
    351348                }
    352349        }
    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);
    362350}
    363351
     
    398386         * be correct, "zero" offset (i.e. the total size) must be aligned
    399387         * to the strictest alignment present.
     388         * Note that the padding is actually in front of the TLS data,
     389         * not after it.
    400390         */
    401391        rtld->tls_size = ALIGN_UP(rtld->tls_size, rtld->tls_align);
    402392
    403         /*
    404          * Space for the TCB.
    405          * Later, the TLS zero offset is equal to the pointer to tcb_t, so
    406          * adding the sizeof(tcb_t) block AFTER we calculated the alignment
    407          * of the remainder above is correct.
    408          */
     393        /* Space for the TCB. */
    409394        rtld->tls_size += sizeof(tcb_t);
    410395#endif
Note: See TracChangeset for help on using the changeset viewer.