Lines Matching defs:pEhdr

1437  * @param   pEhdr       Pointer to the ELF header.
1441 static int RTLDRELF_NAME(ValidateElfHeader)(const Elf_Ehdr *pEhdr, const char *pszLogName, uint64_t cbRawImage,
1457 RT_ELEMENTS(pEhdr->e_ident), &pEhdr->e_ident[0], pEhdr->e_type, pEhdr->e_version,
1458 pEhdr->e_entry, pEhdr->e_phoff, pEhdr->e_shoff,pEhdr->e_flags, pEhdr->e_ehsize, pEhdr->e_phentsize,
1459 pEhdr->e_phnum, pEhdr->e_shentsize, pEhdr->e_shnum, pEhdr->e_shstrndx));
1461 if ( pEhdr->e_ident[EI_MAG0] != ELFMAG0
1462 || pEhdr->e_ident[EI_MAG1] != ELFMAG1
1463 || pEhdr->e_ident[EI_MAG2] != ELFMAG2
1464 || pEhdr->e_ident[EI_MAG3] != ELFMAG3
1467 Log(("RTLdrELF: %s: Invalid ELF magic (%.*Rhxs)\n", pszLogName, sizeof(pEhdr->e_ident), pEhdr->e_ident)); NOREF(pszLogName);
1470 if (pEhdr->e_ident[EI_CLASS] != RTLDRELF_SUFF(ELFCLASS))
1472 Log(("RTLdrELF: %s: Invalid ELF class (%.*Rhxs)\n", pszLogName, sizeof(pEhdr->e_ident), pEhdr->e_ident));
1475 if (pEhdr->e_ident[EI_DATA] != ELFDATA2LSB)
1477 Log(("RTLdrELF: %s: ELF endian %x is unsupported\n", pEhdr->e_ident[EI_DATA]));
1480 if (pEhdr->e_version != EV_CURRENT)
1482 Log(("RTLdrELF: %s: ELF version %x is unsupported\n", pEhdr->e_version));
1486 if (sizeof(Elf_Ehdr) != pEhdr->e_ehsize)
1489 pszLogName, pEhdr->e_ehsize, sizeof(Elf_Ehdr)));
1492 if ( sizeof(Elf_Phdr) != pEhdr->e_phentsize
1493 && ( pEhdr->e_phnum != 0
1494 || pEhdr->e_type == ET_DYN))
1497 pszLogName, pEhdr->e_phentsize, sizeof(Elf_Phdr)));
1500 if (sizeof(Elf_Shdr) != pEhdr->e_shentsize)
1503 pszLogName, pEhdr->e_shentsize, sizeof(Elf_Shdr)));
1507 switch (pEhdr->e_type)
1514 Log(("RTLdrELF: %s: image type %#x is not supported!\n", pszLogName, pEhdr->e_type));
1518 switch (pEhdr->e_machine)
1531 Log(("RTLdrELF: %s: machine type %u is not supported!\n", pEhdr->e_machine));
1535 if ( pEhdr->e_phoff < pEhdr->e_ehsize
1536 && !(pEhdr->e_phoff && pEhdr->e_phnum)
1537 && pEhdr->e_phnum)
1540 pszLogName, pEhdr->e_phoff));
1543 if ( pEhdr->e_phoff + pEhdr->e_phnum * pEhdr->e_phentsize > cbRawImage
1544 || pEhdr->e_phoff + pEhdr->e_phnum * pEhdr->e_phentsize < pEhdr->e_phoff)
1547 pszLogName, pEhdr->e_phoff, pEhdr->e_phnum));
1552 if ( pEhdr->e_shoff < pEhdr->e_ehsize
1553 && !(pEhdr->e_shoff && pEhdr->e_shnum))
1556 pszLogName, pEhdr->e_shoff));
1559 if ( pEhdr->e_shoff + pEhdr->e_shnum * pEhdr->e_shentsize > cbRawImage
1560 || pEhdr->e_shoff + pEhdr->e_shnum * pEhdr->e_shentsize < pEhdr->e_shoff)
1563 pszLogName, pEhdr->e_shoff, pEhdr->e_shnum));
1567 if (pEhdr->e_shstrndx == 0 || pEhdr->e_shstrndx > pEhdr->e_shnum)
1570 pszLogName, pEhdr->e_shstrndx, pEhdr->e_shnum));
1581 * @param pEhdr The elf header.