Lines Matching refs:phdr

415 	const Elf_Phdr *phdr = NULL;  in __elfN()  local
491 phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); in __elfN()
492 if (!aligned(phdr, Elf_Addr)) { in __elfN()
498 if (phdr[i].p_type == PT_LOAD && phdr[i].p_memsz != 0) { in __elfN()
500 prot = __elfN(trans_prot)(phdr[i].p_flags); in __elfN()
503 phdr[i].p_offset, in __elfN()
504 (caddr_t)phdr[i].p_vaddr + in __elfN()
506 phdr[i].p_memsz, in __elfN()
507 phdr[i].p_filesz, prot); in __elfN()
515 base_addr = trunc_page(phdr[i].p_vaddr + rbase); in __elfN()
606 const Elf_Phdr *phdr; in __CONCAT() local
642 phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); in __CONCAT()
643 if (!aligned(phdr, Elf_Addr)) in __CONCAT()
648 if (phdr[i].p_type == PT_LOAD) { in __CONCAT()
650 baddr = phdr[i].p_vaddr; in __CONCAT()
654 if (phdr[i].p_type == PT_INTERP) { in __CONCAT()
663 if (phdr[i].p_filesz == 0 || in __CONCAT()
664 phdr[i].p_filesz > PAGE_SIZE || in __CONCAT()
665 phdr[i].p_filesz > MAXPATHLEN) in __CONCAT()
668 interp = kmalloc(phdr[i].p_filesz, M_TEMP, M_WAITOK); in __CONCAT()
669 failure = extract_interpreter(imgp, &phdr[i], interp); in __CONCAT()
722 switch (phdr[i].p_type) { in __CONCAT()
724 if (phdr[i].p_memsz == 0) in __CONCAT()
726 prot = __elfN(trans_prot)(phdr[i].p_flags); in __CONCAT()
732 phdr[i].p_offset, in __CONCAT()
733 (caddr_t)phdr[i].p_vaddr + et_dyn_addr, in __CONCAT()
734 phdr[i].p_memsz, in __CONCAT()
735 phdr[i].p_filesz, in __CONCAT()
748 if (phdr[i].p_offset == 0 && in __CONCAT()
750 <= phdr[i].p_filesz) in __CONCAT()
751 proghdr = phdr[i].p_vaddr + hdr->e_phoff + in __CONCAT()
754 seg_addr = trunc_page(phdr[i].p_vaddr + et_dyn_addr); in __CONCAT()
755 seg_size = round_page(phdr[i].p_memsz + in __CONCAT()
756 phdr[i].p_vaddr + et_dyn_addr - seg_addr); in __CONCAT()
773 if (hdr->e_entry >= phdr[i].p_vaddr && in __CONCAT()
774 hdr->e_entry < (phdr[i].p_vaddr + in __CONCAT()
775 phdr[i].p_memsz)) { in __CONCAT()
802 proghdr = phdr[i].p_vaddr + et_dyn_addr; in __CONCAT()
857 elf_auxargs->phdr = proghdr; in __CONCAT()
884 AUXARGS_ENTRY(pos, AT_PHDR, args->phdr); in __elfN()
913 Elf_Phdr *phdr; /* Program header to fill in (incremented) */ member
1059 Elf_Phdr *phdr = phc->phdr; in cb_put_phdr() local
1061 if (phc->phdr == phc->phdr_max) in cb_put_phdr()
1066 phdr->p_type = PT_LOAD; in cb_put_phdr()
1067 phdr->p_offset = phc->offset; in cb_put_phdr()
1068 phdr->p_vaddr = entry->ba.start; in cb_put_phdr()
1069 phdr->p_paddr = 0; in cb_put_phdr()
1070 phdr->p_filesz = phdr->p_memsz = entry->ba.end - entry->ba.start; in cb_put_phdr()
1071 phdr->p_align = PAGE_SIZE; in cb_put_phdr()
1072 phdr->p_flags = __elfN(untrans_prot)(entry->protection); in cb_put_phdr()
1074 phc->offset += phdr->p_filesz; in cb_put_phdr()
1075 ++phc->phdr; in cb_put_phdr()
1117 Elf_Phdr *phdr = &vnh->vnh_phdr; in cb_put_fp() local
1167 phdr->p_type = PT_LOAD; in cb_put_fp()
1168 phdr->p_offset = 0; /* not written to core */ in cb_put_fp()
1169 phdr->p_vaddr = entry->ba.start; in cb_put_fp()
1170 phdr->p_paddr = 0; in cb_put_fp()
1171 phdr->p_filesz = phdr->p_memsz = in cb_put_fp()
1173 phdr->p_align = PAGE_SIZE; in cb_put_fp()
1174 phdr->p_flags = 0; in cb_put_fp()
1176 phdr->p_flags |= PF_R; in cb_put_fp()
1178 phdr->p_flags |= PF_W; in cb_put_fp()
1180 phdr->p_flags |= PF_X; in cb_put_fp()
1313 Elf_Phdr *phdr; in __elfN() local
1318 phdr = target_reserve(target, (numsegs + 1) * sizeof(Elf_Phdr), &error); in __elfN()
1372 if (error == 0 && phdr != NULL) { in __elfN()
1379 phdr->p_type = PT_NOTE; in __elfN()
1380 phdr->p_offset = noteoff; in __elfN()
1381 phdr->p_vaddr = 0; in __elfN()
1382 phdr->p_paddr = 0; in __elfN()
1383 phdr->p_filesz = notesz; in __elfN()
1384 phdr->p_memsz = 0; in __elfN()
1385 phdr->p_flags = 0; in __elfN()
1386 phdr->p_align = 0; in __elfN()
1387 ++phdr; in __elfN()
1390 phc.phdr = phdr; in __elfN()
1391 phc.phdr_max = phdr + numsegs; in __elfN()
1675 const Elf_Phdr *phdr, *pnote; in __elfN() local
1681 phdr = (const Elf_Phdr *)(imgp->image_header + hdr->e_phoff); in __elfN()
1684 if (phdr[i].p_type == PT_NOTE) { in __elfN()
1685 pnote = &phdr[i]; in __elfN()