Lines Matching refs:ehdr
297 Elf64_Ehdr ehdr;
300 Elf32_Ehdr ehdr;
306 memcpy(&ehdr, output, sizeof(ehdr));
307 if (ehdr.e_ident[EI_MAG0] != ELFMAG0 ||
308 ehdr.e_ident[EI_MAG1] != ELFMAG1 ||
309 ehdr.e_ident[EI_MAG2] != ELFMAG2 ||
310 ehdr.e_ident[EI_MAG3] != ELFMAG3)
315 phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum);
319 memcpy(phdrs, output + ehdr.e_phoff, sizeof(*phdrs) * ehdr.e_phnum);
321 for (i = 0; i < ehdr.e_phnum; i++) {
344 return ehdr.e_entry - LOAD_PHYSICAL_ADDR;