Lines Matching defs:ehdr
68 Elf_Ehdr *ehdr;
127 ehdr = mmap(NULL, _rtld_pagesz, PROT_READ, MAP_FILE | MAP_SHARED, fd,
129 obj->ehdr = ehdr;
130 if (ehdr == MAP_FAILED) {
135 if (memcmp(ELFMAG, ehdr->e_ident, SELFMAG) != 0) {
139 if (ehdr->e_ident[EI_CLASS] != ELFCLASS) {
141 ehdr->e_ident[EI_CLASS], ELFCLASS);
145 if (ehdr->e_ident[EI_VERSION] != EV_CURRENT ||
146 ehdr->e_version != EV_CURRENT ||
147 ehdr->e_ident[EI_DATA] != ELFDEFNNAME(MACHDEP_ENDIANNESS)) {
151 if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN) {
155 switch (ehdr->e_machine) {
167 assert(ehdr->e_phentsize == sizeof(Elf_Phdr));
168 assert(ehdr->e_phoff + ehdr->e_phnum * sizeof(Elf_Phdr) <=
177 phdr = (Elf_Phdr *) ((caddr_t)ehdr + ehdr->e_phoff);
181 phsize = ehdr->e_phnum * sizeof(phdr[0]);
189 phlimit = phdr + ehdr->e_phnum;
190 segs = xmalloc(sizeof(segs[0]) * ehdr->e_phnum);
270 phdr = (Elf_Phdr *) ((caddr_t)ehdr + ehdr->e_phoff);
271 obj->entry = (void *)(uintptr_t)ehdr->e_entry;
303 obj->isdynamic = ehdr->e_type == ET_DYN;
423 if (segs[i]->p_offset <= ehdr->e_phoff &&
425 phdr_vaddr = segs[i]->p_vaddr + ehdr->e_phoff;
481 if (obj->ehdr != MAP_FAILED)
482 munmap(obj->ehdr, _rtld_pagesz);