Lines Matching refs:phdr

726     const Elf_Phdr *phdr, u_long rbase, u_long *base_addrp)  in __elfN()
739 if (phdr[i].p_type != PT_LOAD || phdr[i].p_memsz == 0) in __elfN()
743 prot = __elfN(trans_prot)(phdr[i].p_flags); in __elfN()
744 error = __elfN(load_section)(imgp, phdr[i].p_offset, in __elfN()
745 (caddr_t)(uintptr_t)phdr[i].p_vaddr + rbase, in __elfN()
746 phdr[i].p_memsz, phdr[i].p_filesz, prot); in __elfN()
754 base_addr = trunc_page(phdr[i].p_vaddr + rbase); in __elfN()
787 const Elf_Phdr *phdr = NULL; in __elfN() local
855 phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); in __elfN()
856 if (!aligned(phdr, Elf_Addr)) { in __elfN()
861 error = __elfN(load_sections)(imgp, hdr, phdr, rbase, &base_addr); in __elfN()
927 const Elf_Phdr *phdr) in __elfN()
939 if (phdr[i].p_type != PT_LOAD || phdr[i].p_memsz == 0) in __elfN()
942 seg_addr = trunc_page(phdr[i].p_vaddr + imgp->et_dyn_addr); in __elfN()
943 seg_size = round_page(phdr[i].p_memsz + in __elfN()
944 phdr[i].p_vaddr + imgp->et_dyn_addr - seg_addr); in __elfN()
956 if ((phdr[i].p_flags & PF_X) != 0 && text_size < seg_size) { in __elfN()
1003 __elfN(get_interp)(struct image_params *imgp, const Elf_Phdr *phdr, in __elfN()
1010 KASSERT(phdr->p_type == PT_INTERP, in __elfN()
1011 ("%s: p_type %u != PT_INTERP", __func__, phdr->p_type)); in __elfN()
1017 if (phdr->p_filesz < 2 || phdr->p_filesz > MAXPATHLEN) { in __elfN()
1022 interp_name_len = phdr->p_filesz; in __elfN()
1023 if (phdr->p_offset > PAGE_SIZE || in __elfN()
1024 interp_name_len > PAGE_SIZE - phdr->p_offset) { in __elfN()
1042 interp_name_len, phdr->p_offset, in __elfN()
1057 interp = __DECONST(char *, imgp->image_header) + phdr->p_offset; in __elfN()
1102 const Elf_Phdr *phdr; in __CONCAT() local
1137 phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); in __CONCAT()
1138 if (!aligned(phdr, Elf_Addr)) { in __CONCAT()
1170 switch (phdr[i].p_type) { in __CONCAT()
1173 baddr = phdr[i].p_vaddr; in __CONCAT()
1174 if (!powerof2(phdr[i].p_align) || in __CONCAT()
1175 phdr[i].p_align > maxsalign) { in __CONCAT()
1180 if (phdr[i].p_align > maxalign) in __CONCAT()
1181 maxalign = phdr[i].p_align; in __CONCAT()
1182 if (mapsz + phdr[i].p_memsz < mapsz) { in __CONCAT()
1187 mapsz += phdr[i].p_memsz; in __CONCAT()
1196 if (phdr[i].p_offset == 0 && in __CONCAT()
1198 phdr[i].p_filesz) in __CONCAT()
1199 proghdr = phdr[i].p_vaddr + hdr->e_phoff; in __CONCAT()
1208 error = __elfN(get_interp)(imgp, &phdr[i], &interp, in __CONCAT()
1216 __elfN(trans_prot)(phdr[i].p_flags); in __CONCAT()
1224 imgp->stack_sz = phdr[i].p_memsz; in __CONCAT()
1227 proghdr = phdr[i].p_vaddr; in __CONCAT()
1346 error = __elfN(load_sections)(imgp, hdr, phdr, imgp->et_dyn_addr, NULL); in __CONCAT()
1350 error = __elfN(enforce_limits)(imgp, hdr, phdr); in __CONCAT()
1416 elf_auxargs->phdr = proghdr + imgp->et_dyn_addr; in __CONCAT()
1458 AUXARGS_ENTRY(pos, AT_PHDR, args->phdr); in __elfN()
1546 Elf_Phdr *phdr; /* Program header to fill in */ member
1715 Elf_Phdr *phdr = phc->phdr; in cb_put_phdr() local
1719 phdr->p_type = PT_LOAD; in cb_put_phdr()
1720 phdr->p_offset = phc->offset; in cb_put_phdr()
1721 phdr->p_vaddr = entry->start; in cb_put_phdr()
1722 phdr->p_paddr = 0; in cb_put_phdr()
1723 phdr->p_filesz = phdr->p_memsz = entry->end - entry->start; in cb_put_phdr()
1724 phdr->p_align = PAGE_SIZE; in cb_put_phdr()
1725 phdr->p_flags = __elfN(untrans_prot)(entry->protection); in cb_put_phdr()
1727 phc->offset += phdr->p_filesz; in cb_put_phdr()
1728 phc->phdr++; in cb_put_phdr()
1911 Elf_Phdr *phdr; in __elfN() local
1973 phdr = (Elf_Phdr *)((char *)hdr + ehdr->e_phoff); in __elfN()
1976 phdr->p_type = PT_NOTE; in __elfN()
1977 phdr->p_offset = hdrsize; in __elfN()
1978 phdr->p_vaddr = 0; in __elfN()
1979 phdr->p_paddr = 0; in __elfN()
1980 phdr->p_filesz = notesz; in __elfN()
1981 phdr->p_memsz = 0; in __elfN()
1982 phdr->p_flags = PF_R; in __elfN()
1983 phdr->p_align = ELF_NOTE_ROUNDSIZE; in __elfN()
1984 phdr++; in __elfN()
1987 phc.phdr = phdr; in __elfN()
2857 const Elf_Phdr *phdr; in __elfN() local
2864 phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); in __elfN()
2871 if (phdr[i].p_type == PT_NOTE && __elfN(parse_notes)(imgp, in __elfN()
2872 &brandnote->hdr, brandnote->vendor, &phdr[i], brandnote_cb, in __elfN()
2875 if (phdr[j].p_type == PT_NOTE && in __elfN()
2877 FREEBSD_ABI_VENDOR, &phdr[j], in __elfN()