Lines Matching defs:hdr

88 static int __elfN(check_header)(const Elf_Ehdr *hdr);
205 .hdr.n_namesz = sizeof(FREEBSD_ABI_VENDOR),
206 .hdr.n_descsz = sizeof(int32_t),
207 .hdr.n_type = NT_FREEBSD_ABI_TAG,
229 .hdr.n_namesz = sizeof(GNU_ABI_VENDOR),
230 .hdr.n_descsz = 16, /* XXX at least 16 */
231 .hdr.n_type = 1,
316 const Elf_Ehdr *hdr = (const Elf_Ehdr *)imgp->image_header;
338 if (hdr->e_machine == bi->machine && (bi->flags &
381 if (hdr->e_machine == bi->machine &&
382 (hdr->e_ident[EI_OSABI] == bi->brand ||
384 strcmp((const char *)&hdr->e_ident[OLD_EI_BRAND],
415 if (hdr->e_machine == bi->machine) {
430 if (hdr->e_machine == bi->machine &&
447 if (hdr->e_machine == bi->machine &&
457 __elfN(phdr_in_zero_page)(const Elf_Ehdr *hdr)
459 return (hdr->e_phoff <= PAGE_SIZE &&
460 (u_int)hdr->e_phentsize * hdr->e_phnum <= PAGE_SIZE - hdr->e_phoff);
464 __elfN(check_header)(const Elf_Ehdr *hdr)
469 if (!IS_ELF(*hdr) ||
470 hdr->e_ident[EI_CLASS] != ELF_TARG_CLASS ||
471 hdr->e_ident[EI_DATA] != ELF_TARG_DATA ||
472 hdr->e_ident[EI_VERSION] != EV_CURRENT ||
473 hdr->e_phentsize != sizeof(Elf_Phdr) ||
474 hdr->e_version != ELF_TARG_VER)
483 if (bi != NULL && bi->machine == hdr->e_machine)
701 __elfN(load_sections)(struct image_params *imgp, const Elf_Ehdr *hdr,
714 for (i = 0; i < hdr->e_phnum; i++) {
762 const Elf_Ehdr *hdr = NULL;
813 hdr = (const Elf_Ehdr *)imgp->image_header;
814 if ((error = __elfN(check_header)(hdr)) != 0)
816 if (hdr->e_type == ET_DYN)
818 else if (hdr->e_type == ET_EXEC)
826 if (!__elfN(phdr_in_zero_page)(hdr)) {
831 phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
837 error = __elfN(load_sections)(imgp, hdr, phdr, rbase, &base_addr);
842 *entry = (unsigned long)hdr->e_entry + rbase;
883 __elfN(enforce_limits)(struct image_params *imgp, const Elf_Ehdr *hdr,
895 for (i = 0; i < hdr->e_phnum; i++) {
1070 const Elf_Ehdr *hdr;
1085 hdr = (const Elf_Ehdr *)imgp->image_header;
1093 if (__elfN(check_header)(hdr) != 0 ||
1094 (hdr->e_type != ET_EXEC && hdr->e_type != ET_DYN))
1102 if (!__elfN(phdr_in_zero_page)(hdr)) {
1106 phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
1123 for (i = 0; i < hdr->e_phnum; i++) {
1140 hdr->e_phoff + hdr->e_phnum * hdr->e_phentsize
1142 proghdr = phdr[i].p_vaddr + hdr->e_phoff;
1171 hdr->e_ident[EI_OSABI]);
1177 if (hdr->e_type == ET_DYN) {
1231 (__elfN(aslr_enabled) && hdr->e_type == ET_EXEC) ||
1268 error = __elfN(load_sections)(imgp, hdr, phdr, et_dyn_addr, NULL);
1272 error = __elfN(enforce_limits)(imgp, hdr, phdr, et_dyn_addr);
1276 entry = (u_long)hdr->e_entry + et_dyn_addr;
1326 elf_auxargs->phent = hdr->e_phentsize;
1327 elf_auxargs->phnum = hdr->e_phnum;
1332 elf_auxargs->hdr_eflags = hdr->e_flags;
1339 imgp->proc->p_elf_machine = hdr->e_machine;
1340 imgp->proc->p_elf_flags = hdr->e_flags;
1663 void *hdr, *tmpbuf;
1666 hdr = NULL;
1728 hdr = malloc(hdrsize, M_TEMP, M_WAITOK);
1729 error = __elfN(corehdr)(&params, seginfo.count, hdr, hdrsize, &notelst,
1738 php = (Elf_Phdr *)((char *)hdr + sizeof(Elf_Ehdr)) + 1;
1765 if (hdr != NULL)
1766 free(hdr, M_TEMP);
1880 __elfN(corehdr)(struct coredump_params *p, int numsegs, void *hdr,
1889 bzero(hdr, hdrsize);
1890 __elfN(puthdr)(p->td, hdr, hdrsize, numsegs, notesz, flags);
1895 sbuf_bcat(sb, hdr, hdrsize);
1967 __elfN(puthdr)(struct thread *td, void *hdr, size_t hdrsize, int numsegs,
1975 ehdr = (Elf_Ehdr *)hdr;
2010 shdr = (Elf_Shdr *)((char *)hdr + ehdr->e_shoff);
2031 phdr = (Elf_Phdr *)((char *)hdr + ehdr->e_phoff);
2766 const Elf_Ehdr *hdr;
2771 hdr = (const Elf_Ehdr *)imgp->image_header;
2772 phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff);
2778 for (i = 0; i < hdr->e_phnum; i++) {
2780 &brandnote->hdr, brandnote->vendor, &phdr[i], brandnote_cb,
2782 for (j = 0; j < hdr->e_phnum; j++) {