Changeset 634e020 in mainline


Ignore:
Timestamp:
2016-04-28T18:25:29Z (8 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5035ba05
Parents:
9182e86f
Message:

When in doubt, keep re-reading the specs again and again.

Location:
uspace/lib/c
Files:
2 edited

Legend:

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

    r9182e86f r634e020  
    6262        module_process_pre_arch(m);
    6363
    64         if (m->dyn.plt_rel == DT_REL) {
    65                 DPRINTF("table type DT_REL\n");
    66                 if (m->dyn.rel != NULL) {
    67                         DPRINTF("non-empty\n");
    68                         rel_table_process(m, m->dyn.rel, m->dyn.rel_sz);
    69                 }
    70                 /* FIXME: this seems wrong */
    71                 if (m->dyn.jmp_rel != NULL) {
    72                 DPRINTF("table type jmp-rel\n");
    73                         DPRINTF("non-empty\n");
     64        /* jmp_rel table */
     65        if (m->dyn.jmp_rel != NULL) {
     66                DPRINTF("jmp_rel table\n");
     67                if (m->dyn.plt_rel == DT_REL) {
     68                        DPRINTF("jmp_rel table type DT_REL\n");
    7469                        rel_table_process(m, m->dyn.jmp_rel, m->dyn.plt_rel_sz);
    75                 }
    76         } else { /* (m->dyn.plt_rel == DT_RELA) */
    77                 DPRINTF("table type DT_RELA\n");
    78                 if (m->dyn.rela != NULL) {
    79                         DPRINTF("non-empty\n");
    80                         rela_table_process(m, m->dyn.rela, m->dyn.rela_sz);
    81                 }
     70                } else {
     71                        assert(m->dyn.plt_rel == DT_RELA);
     72                        DPRINTF("jmp_rel table type DT_RELA\n");
     73                        rela_table_process(m, m->dyn.jmp_rel, m->dyn.plt_rel_sz);
     74                }
     75        }
     76
     77        /* rel table */
     78        if (m->dyn.rel != NULL) {
     79                DPRINTF("rel table\n");
     80                rel_table_process(m, m->dyn.rel, m->dyn.rel_sz);
     81        }
     82
     83        /* rela table */
     84        if (m->dyn.rela != NULL) {
     85                DPRINTF("rela table\n");
     86                rela_table_process(m, m->dyn.rela, m->dyn.rela_sz);
    8287        }
    8388
  • uspace/lib/c/include/rtld/dynamic.h

    r9182e86f r634e020  
    4848 */
    4949typedef struct dyn_info {
    50         /** Type of relocations used for the PLT, either DT_REL or DT_RELA */
    51         int plt_rel;
    52 
    5350        /** Relocation table without explicit addends */
    5451        void *rel;
     
    6461        void *jmp_rel;
    6562        size_t plt_rel_sz;
     63        /** Type of relocations used for the PLT, either DT_REL or DT_RELA */
     64        int plt_rel;
    6665
    6766        /** Pointer to PLT/GOT (processor-specific) */
Note: See TracChangeset for help on using the changeset viewer.