Lines Matching refs:phdr
43 Elf_Phdr **phdr);
68 Elf_Phdr *phdr; in map_object() local
104 hdr = get_elf_header(fd, path, sb, &phdr); in map_object()
112 phsize = hdr->e_phnum * sizeof(phdr[0]); in map_object()
113 phlimit = phdr + hdr->e_phnum; in map_object()
126 while (phdr < phlimit) { in map_object()
127 switch (phdr->p_type) { in map_object()
130 phinterp = phdr; in map_object()
134 segs[++nsegs] = phdr; in map_object()
148 phdr_vaddr = phdr->p_vaddr; in map_object()
149 phsize = phdr->p_memsz; in map_object()
153 phdyn = phdr; in map_object()
157 phtls = phdr; in map_object()
161 stack_flags = phdr->p_flags; in map_object()
165 relro_page = phdr->p_vaddr; in map_object()
166 relro_size = phdr->p_memsz; in map_object()
170 if (phdr->p_offset > page_size || in map_object()
171 phdr->p_offset + phdr->p_filesz > page_size) { in map_object()
172 note_map_len = rtld_round_page(phdr->p_offset + in map_object()
173 phdr->p_filesz) - rtld_trunc_page(phdr->p_offset); in map_object()
175 MAP_PRIVATE, fd, rtld_trunc_page(phdr->p_offset)); in map_object()
180 note_start = (Elf_Addr)(note_map + phdr->p_offset - in map_object()
181 rtld_trunc_page(phdr->p_offset)); in map_object()
183 note_start = (Elf_Addr)(char *)hdr + phdr->p_offset; in map_object()
185 note_end = note_start + phdr->p_filesz; in map_object()
189 ++phdr; in map_object()
302 obj->phdr = (const Elf_Phdr *)(obj->relocbase + phdr_vaddr); in map_object()
304 obj->phdr = malloc(phsize); in map_object()
305 if (obj->phdr == NULL) { in map_object()
310 memcpy(__DECONST(char *, obj->phdr), (char *)hdr + hdr->e_phoff, phsize); in map_object()
342 munmap(phdr, hdr->e_phnum * sizeof(phdr[0])); in map_object()
385 Elf_Phdr *phdr; in get_elf_header() local
410 phdr = (Elf_Phdr *)((char *)hdr + hdr->e_phoff); in get_elf_header()
412 phdr = mmap(NULL, hdr->e_phnum * sizeof(phdr[0]), in get_elf_header()
415 if (phdr == MAP_FAILED) { in get_elf_header()
421 *phdr_p = phdr; in get_elf_header()
467 free(__DECONST(void *, obj->phdr)); in obj_free()