Lines Matching refs:eh

118 elf_placedynexec(struct exec_package *epp, Elf_Ehdr *eh, Elf_Phdr *ph)  in elf_placedynexec()  argument
123 for (align = i = 0; i < eh->e_phnum; i++) in elf_placedynexec()
130 for (i = 0; i < eh->e_phnum; i++) in elf_placedynexec()
133 eh->e_entry += offset; in elf_placedynexec()
258 elf_check_header(Elf_Ehdr *eh) in elf_check_header() argument
261 if (memcmp(eh->e_ident, ELFMAG, SELFMAG) != 0 || in elf_check_header()
262 eh->e_ident[EI_CLASS] != ELFCLASS) in elf_check_header()
265 switch (eh->e_machine) { in elf_check_header()
273 if (ELF_EHDR_FLAGS_OK(eh) == 0) in elf_check_header()
276 if (eh->e_shnum > ELF_MAXSHNUM || eh->e_phnum > ELF_MAXPHNUM) in elf_check_header()
379 Elf_Ehdr eh; in elf_load_interp() local
448 if ((error = exec_read_from(l, vp, 0, &eh, sizeof(eh))) != 0) in elf_load_interp()
451 if ((error = elf_check_header(&eh)) != 0) in elf_load_interp()
453 if (eh.e_type != ET_DYN || eh.e_phnum == 0) { in elf_load_interp()
458 phsize = eh.e_phnum * sizeof(Elf_Phdr); in elf_load_interp()
461 if ((error = exec_read_from(l, vp, eh.e_phoff, ph, phsize)) != 0) in elf_load_interp()
487 for (i = 0, base_ph = NULL; i < eh.e_phnum; i++) { in elf_load_interp()
518 for (i = 0, base_ph = NULL, last_ph = NULL; i < eh.e_phnum; i++) { in elf_load_interp()
567 if (eh.e_entry >= ph[i].p_vaddr && in elf_load_interp()
568 eh.e_entry < (ph[i].p_vaddr + size)) { in elf_load_interp()
569 *entryoff = eh.e_entry - base_ph->p_vaddr; in elf_load_interp()
610 Elf_Ehdr *eh = epp->ep_hdr; in exec_elf_makecmds() local
621 if ((error = elf_check_header(eh)) != 0) in exec_elf_makecmds()
624 if (eh->e_type == ET_DYN) in exec_elf_makecmds()
627 else if (eh->e_type != ET_EXEC) in exec_elf_makecmds()
630 if (eh->e_phnum == 0) in exec_elf_makecmds()
641 phsize = eh->e_phnum * sizeof(Elf_Phdr); in exec_elf_makecmds()
644 if ((error = exec_read_from(l, epp->ep_vp, eh->e_phoff, ph, phsize)) != in exec_elf_makecmds()
651 for (i = 0; i < eh->e_phnum; i++) { in exec_elf_makecmds()
683 error = (*epp->ep_esch->u.elf_probe_func)(l, epp, eh, interp, in exec_elf_makecmds()
691 elf_placedynexec(epp, eh, ph); in exec_elf_makecmds()
696 for (i = 0; i < eh->e_phnum; i++) { in exec_elf_makecmds()
722 computed_phdr = ph[i].p_vaddr + eh->e_phoff; in exec_elf_makecmds()
783 epp->ep_entry = eh->e_entry; in exec_elf_makecmds()
793 ap->arg_phentsize = eh->e_phentsize; in exec_elf_makecmds()
794 ap->arg_phnum = eh->e_phnum; in exec_elf_makecmds()
795 ap->arg_entry = eh->e_entry; in exec_elf_makecmds()
824 Elf_Ehdr *eh) in netbsd_elf_signature() argument
842 if (eh->e_shnum > ELF_MAXSHNUM || eh->e_shnum == 0) in netbsd_elf_signature()
845 shsize = eh->e_shnum * sizeof(Elf_Shdr); in netbsd_elf_signature()
847 error = exec_read_from(l, epp->ep_vp, eh->e_shoff, sh, shsize); in netbsd_elf_signature()
852 for (i = 0; i < eh->e_shnum; i++) { in netbsd_elf_signature()
1013 netbsd_elf_probe(struct lwp *l, struct exec_package *epp, void *eh, char *itp, in netbsd_elf_probe() argument
1018 if ((error = netbsd_elf_signature(l, epp, eh)) != 0) in netbsd_elf_probe()
1021 if ((error = ELF_MD_PROBE_FUNC(l, epp, eh, itp, pos)) != 0) in netbsd_elf_probe()