Changeset e3f819f in mainline
- Timestamp:
- 2018-04-10T18:51:14Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 57d44dd
- Parents:
- 3f932a7e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/lib/elf.c
r3f932a7e re3f819f 60 60 static int segment_header(elf_segment_header_t *, elf_header_t *, as_t *, 61 61 unsigned int); 62 static int section_header(elf_section_header_t *, elf_header_t *, as_t *);63 62 static int load_segment(elf_segment_header_t *, elf_header_t *, as_t *); 64 63 … … 92 91 return EE_INCOMPATIBLE; 93 92 94 if (header->e_shentsize != sizeof(elf_section_header_t))95 return EE_INCOMPATIBLE;96 97 93 /* Check if the object type is supported. */ 98 94 if (header->e_type != ET_EXEC) … … 111 107 112 108 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);124 109 if (rc != EE_OK) 125 110 return rc; … … 240 225 } 241 226 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 272 227 /** @} 273 228 */
Note:
See TracChangeset
for help on using the changeset viewer.