Changeset e3f819f in mainline


Ignore:
Timestamp:
2018-04-10T18:51:14Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
57d44dd
Parents:
3f932a7e
Message:

No sense reading sections in the kernel either.

File:
1 edited

Legend:

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

    r3f932a7e re3f819f  
    6060static int segment_header(elf_segment_header_t *, elf_header_t *, as_t *,
    6161    unsigned int);
    62 static int section_header(elf_section_header_t *, elf_header_t *, as_t *);
    6362static int load_segment(elf_segment_header_t *, elf_header_t *, as_t *);
    6463
     
    9291                return EE_INCOMPATIBLE;
    9392
    94         if (header->e_shentsize != sizeof(elf_section_header_t))
    95                 return EE_INCOMPATIBLE;
    96 
    9793        /* Check if the object type is supported. */
    9894        if (header->e_type != ET_EXEC)
     
    111107
    112108                int rc = segment_header(seghdr, header, as, flags);
    113                 if (rc != EE_OK)
    114                         return rc;
    115         }
    116 
    117         /* Inspect all section headers and process them. */
    118         for (i = 0; i < header->e_shnum; i++) {
    119                 elf_section_header_t *sechdr =
    120                     &((elf_section_header_t *)(((uint8_t *) header) +
    121                     header->e_shoff))[i];
    122 
    123                 int rc = section_header(sechdr, header, as);
    124109                if (rc != EE_OK)
    125110                        return rc;
     
    240225}
    241226
    242 /** Process section header.
    243  *
    244  * @param entry Segment header.
    245  * @param elf   ELF header.
    246  * @param as    Address space into wich the ELF is being loaded.
    247  *
    248  * @return EE_OK on success, error code otherwise.
    249  *
    250  */
    251 static int section_header(elf_section_header_t *entry, elf_header_t *elf,
    252     as_t *as)
    253 {
    254         switch (entry->sh_type) {
    255         case SHT_PROGBITS:
    256                 if (entry->sh_flags & SHF_TLS) {
    257                         /* .tdata */
    258                 }
    259                 break;
    260         case SHT_NOBITS:
    261                 if (entry->sh_flags & SHF_TLS) {
    262                         /* .tbss */
    263                 }
    264                 break;
    265         default:
    266                 break;
    267         }
    268 
    269         return EE_OK;
    270 }
    271 
    272227/** @}
    273228 */
Note: See TracChangeset for help on using the changeset viewer.