Changeset c98e6ee in mainline for kernel/generic/src/lib/elf.c


Ignore:
Timestamp:
2008-07-08T16:05:45Z (16 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f93f168
Parents:
b7f9087
Message:

Merge program-loader related stuff from dynload branch to trunk. (huge)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/lib/elf.c

    rb7f9087 rc98e6ee  
    5858
    5959static int segment_header(elf_segment_header_t *entry, elf_header_t *elf,
    60     as_t *as);
     60    as_t *as, int flags);
    6161static int section_header(elf_section_header_t *entry, elf_header_t *elf,
    6262    as_t *as);
     
    6868 * @param header Pointer to ELF header in memory
    6969 * @param as Created and properly mapped address space
     70 * @param flags A combination of ELD_F_*
    7071 * @return EE_OK on success
    7172 */
    72 unsigned int elf_load(elf_header_t *header, as_t * as)
     73unsigned int elf_load(elf_header_t *header, as_t * as, int flags)
    7374{
    7475        int i, rc;
     
    111112                seghdr = &((elf_segment_header_t *)(((uint8_t *) header) +
    112113                    header->e_phoff))[i];
    113                 rc = segment_header(seghdr, header, as);
     114                rc = segment_header(seghdr, header, as, flags);
    114115                if (rc != EE_OK)
    115116                        return rc;
     
    152153 */
    153154static int segment_header(elf_segment_header_t *entry, elf_header_t *elf,
    154     as_t *as)
    155 {
     155    as_t *as, int flags)
     156{
     157        char *interp;
     158
    156159        switch (entry->p_type) {
    157160        case PT_NULL:
     
    163166        case PT_DYNAMIC:
    164167        case PT_INTERP:
     168                interp = (char *)elf + entry->p_offset;
     169                /* FIXME */
     170                /*if (memcmp((uintptr_t)interp, (uintptr_t)ELF_INTERP_ZSTR,
     171                    ELF_INTERP_ZLEN) != 0) {
     172                        return EE_UNSUPPORTED;
     173                }*/
     174                if ((flags & ELD_F_LOADER) == 0) {
     175                        return EE_LOADER;
     176                }
     177                break;
    165178        case PT_SHLIB:
    166179        case PT_NOTE:
Note: See TracChangeset for help on using the changeset viewer.