Lines Matching refs:phdr
499 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem); in check_elf_header() local
500 if (phdr == NULL) in check_elf_header()
867 GElf_Phdr *phdr = NULL; in check_symtab() local
872 phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem); in check_symtab()
873 if (phdr != NULL && phdr->p_type == PT_TLS) in check_symtab()
884 else if (phdr == NULL) in check_symtab()
893 < destshdr->sh_offset - phdr->p_offset) in check_symtab()
899 > (destshdr->sh_offset - phdr->p_offset in check_symtab()
906 > (destshdr->sh_offset - phdr->p_offset in check_symtab()
1034 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem); in check_symtab() local
1036 if (phdr != NULL && phdr->p_type == PT_DYNAMIC) in check_symtab()
1038 if (sym->st_value != phdr->p_vaddr) in check_symtab()
1043 (uint64_t) phdr->p_vaddr); in check_symtab()
1045 if (!gnuld && sym->st_size != phdr->p_memsz) in check_symtab()
1050 (uint64_t) phdr->p_memsz); in check_symtab()
1304 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, i, &phdr_mem); in check_reloc_shdr() local
1305 if (phdr == NULL) in check_reloc_shdr()
1308 if (phdr->p_type == PT_LOAD) in check_reloc_shdr()
1311 newp->from = phdr->p_vaddr; in check_reloc_shdr()
1312 newp->to = phdr->p_vaddr + phdr->p_memsz; in check_reloc_shdr()
1313 newp->read_only = (phdr->p_flags & PF_W) == 0; in check_reloc_shdr()
1317 else if (phdr->p_type == PT_DYNAMIC) in check_reloc_shdr()
1319 Elf_Scn *dynscn = gelf_offscn (ebl->elf, phdr->p_offset); in check_reloc_shdr()
1788 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, n, &phdr_mem); in check_dynamic() local
1789 if (phdr != NULL && phdr->p_type == PT_LOAD in check_dynamic()
1790 && phdr->p_vaddr <= dyn->d_un.d_ptr in check_dynamic()
1791 && phdr->p_vaddr + phdr->p_memsz > dyn->d_un.d_ptr) in check_dynamic()
3040 GElf_Phdr *phdr = NULL; in unknown_dependency_p() local
3044 if ((phdr = gelf_getphdr (elf, i, &phdr_mem)) != NULL in unknown_dependency_p()
3045 && phdr->p_type == PT_DYNAMIC) in unknown_dependency_p()
3050 assert (phdr != NULL); in unknown_dependency_p()
3051 Elf_Scn *scn = gelf_offscn (elf, phdr->p_offset); in unknown_dependency_p()
4029 GElf_Phdr *phdr; in check_sections() local
4032 if ((phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem)) != NULL in check_sections()
4033 && ((phdr->p_type == PT_LOAD in check_sections()
4035 || (phdr->p_type == PT_TLS in check_sections()
4037 && phdr->p_offset <= shdr->sh_offset in check_sections()
4038 && ((shdr->sh_offset - phdr->p_offset <= phdr->p_filesz in check_sections()
4039 && (shdr->sh_offset - phdr->p_offset < phdr->p_filesz in check_sections()
4041 || (shdr->sh_offset - phdr->p_offset < phdr->p_memsz in check_sections()
4045 if (phdr->p_offset + phdr->p_memsz in check_sections()
4053 if (shdr->sh_offset < phdr->p_offset + phdr->p_filesz in check_sections()
4091 const GElf_Off end = phdr->p_offset + phdr->p_filesz; in check_sections()
4104 if ((phdr->p_flags & PF_X) == 0) in check_sections()
4114 && (phdr->p_flags & PF_W) == 0) in check_sections()
4219 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem); in check_sections() local
4220 if (phdr != NULL && (phdr->p_type == PT_LOAD || phdr->p_type == PT_TLS)) in check_sections()
4222 if ((phdr->p_flags & PF_X) != 0 in check_sections()
4228 if ((phdr->p_flags & PF_W) != 0 in check_sections()
4390 check_note (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Phdr *phdr, int cnt) in check_note() argument
4402 if (phdr->p_filesz == 0) in check_note()
4407 phdr->p_offset, phdr->p_filesz, in check_note()
4408 (phdr->p_align == 8 in check_note()
4411 notes_size = check_note_data (ebl, ehdr, data, 0, cnt, phdr->p_offset); in check_note()
4416 else if (notes_size != phdr->p_filesz) in check_note()
4418 cnt, phdr->p_filesz - notes_size); in check_note()
4476 GElf_Phdr *phdr; in check_program_header() local
4478 phdr = gelf_getphdr (ebl->elf, cnt, &phdr_mem); in check_program_header()
4479 if (phdr == NULL) in check_program_header()
4486 if (phdr->p_type >= PT_NUM && phdr->p_type != PT_GNU_EH_FRAME in check_program_header()
4487 && phdr->p_type != PT_GNU_STACK && phdr->p_type != PT_GNU_RELRO in check_program_header()
4489 && ebl_segment_type_name (ebl, phdr->p_type, NULL, 0) == NULL) in check_program_header()
4492 cnt, (uint64_t) phdr->p_type); in check_program_header()
4494 if (phdr->p_type == PT_LOAD) in check_program_header()
4496 else if (phdr->p_type == PT_INTERP) in check_program_header()
4506 else if (phdr->p_type == PT_TLS) in check_program_header()
4511 else if (phdr->p_type == PT_NOTE) in check_program_header()
4512 check_note (ebl, ehdr, phdr, cnt); in check_program_header()
4513 else if (phdr->p_type == PT_DYNAMIC) in check_program_header()
4529 if (phdr->p_offset != shdr->sh_offset) in check_program_header()
4532 if (phdr->p_memsz != shdr->sh_size) in check_program_header()
4540 else if (phdr->p_type == PT_GNU_RELRO) in check_program_header()
4559 && phdr->p_vaddr >= phdr2->p_vaddr in check_program_header()
4560 && (phdr->p_vaddr + phdr->p_memsz in check_program_header()
4569 if (phdr->p_vaddr == phdr2->p_vaddr in check_program_header()
4570 && (phdr->p_vaddr + phdr->p_memsz in check_program_header()
4574 != (phdr->p_flags & ~PF_W)) in check_program_header()
4581 if ((phdr->p_flags & ~phdr2->p_flags) != 0) in check_program_header()
4595 else if (phdr->p_type == PT_PHDR) in check_program_header()
4607 && phdr->p_vaddr >= phdr2->p_vaddr in check_program_header()
4608 && (phdr->p_vaddr + phdr->p_memsz in check_program_header()
4619 if (phdr->p_offset != ehdr->e_phoff) in check_program_header()
4623 else if (phdr->p_type == PT_GNU_EH_FRAME) in check_program_header()
4646 if (phdr->p_offset != shdr->sh_offset) in check_program_header()
4649 if (phdr->p_memsz != shdr->sh_size) in check_program_header()
4670 if ((phdr->p_flags & PF_R) == 0) in check_program_header()
4677 if ((phdr->p_flags & PF_W) != 0) in check_program_header()
4685 if ((phdr->p_flags & PF_X) != 0) in check_program_header()
4698 if (phdr->p_filesz > phdr->p_memsz in check_program_header()
4699 && (phdr->p_memsz != 0 || phdr->p_type != PT_NOTE)) in check_program_header()
4704 if (phdr->p_align > 1) in check_program_header()
4706 if (!powerof2 (phdr->p_align)) in check_program_header()
4709 else if ((phdr->p_vaddr - phdr->p_offset) % phdr->p_align != 0) in check_program_header()