Lines Matching refs:phdr

396     const ElfW(Phdr)* phdr = &phdr_table_[i];  in ReadDynamicSection()
397 if (phdr->p_type == PT_DYNAMIC) { in ReadDynamicSection()
398 pt_dynamic_offset = phdr->p_offset; in ReadDynamicSection()
399 pt_dynamic_filesz = phdr->p_filesz; in ReadDynamicSection()
502 const ElfW(Phdr)* phdr = &phdr_table[i]; in phdr_table_get_load_size()
504 if (phdr->p_type != PT_LOAD) { in phdr_table_get_load_size()
509 if (phdr->p_vaddr < min_vaddr) { in phdr_table_get_load_size()
510 min_vaddr = phdr->p_vaddr; in phdr_table_get_load_size()
513 if (phdr->p_vaddr + phdr->p_memsz > max_vaddr) { in phdr_table_get_load_size()
514 max_vaddr = phdr->p_vaddr + phdr->p_memsz; in phdr_table_get_load_size()
540 const ElfW(Phdr)* phdr = &phdr_table[i]; in phdr_table_get_maximum_alignment()
543 if (phdr->p_type != PT_LOAD || ((phdr->p_align & (phdr->p_align - 1)) != 0)) { in phdr_table_get_maximum_alignment()
547 if (phdr->p_align > maximum_alignment) { in phdr_table_get_maximum_alignment()
548 maximum_alignment = phdr->p_align; in phdr_table_get_maximum_alignment()
688 const ElfW(Phdr)* phdr = &phdr_table_[i]; in LoadSegments()
690 if (phdr->p_type != PT_LOAD) { in LoadSegments()
695 ElfW(Addr) seg_start = phdr->p_vaddr + load_bias_; in LoadSegments()
696 ElfW(Addr) seg_end = seg_start + phdr->p_memsz; in LoadSegments()
701 ElfW(Addr) seg_file_end = seg_start + phdr->p_filesz; in LoadSegments()
704 ElfW(Addr) file_start = phdr->p_offset; in LoadSegments()
705 ElfW(Addr) file_end = file_start + phdr->p_filesz; in LoadSegments()
718 name_.c_str(), i, reinterpret_cast<void*>(phdr->p_offset), in LoadSegments()
719 reinterpret_cast<void*>(phdr->p_filesz), in LoadSegments()
725 int prot = PFLAGS_TO_PROT(phdr->p_flags); in LoadSegments()
752 if ((phdr->p_flags & PF_X) && phdr->p_align == kPmdSize && in LoadSegments()
760 if ((phdr->p_flags & PF_W) != 0 && PAGE_OFFSET(seg_file_end) > 0) { in LoadSegments()
774 PFLAGS_TO_PROT(phdr->p_flags), in LoadSegments()
795 const ElfW(Phdr)* phdr = phdr_table; in _phdr_table_set_load_prot()
796 const ElfW(Phdr)* phdr_limit = phdr + phdr_count; in _phdr_table_set_load_prot()
798 for (; phdr < phdr_limit; phdr++) { in _phdr_table_set_load_prot()
799 if (phdr->p_type != PT_LOAD || (phdr->p_flags & PF_W) != 0) { in _phdr_table_set_load_prot()
803 ElfW(Addr) seg_page_start = PAGE_START(phdr->p_vaddr) + load_bias; in _phdr_table_set_load_prot()
804 ElfW(Addr) seg_page_end = PAGE_END(phdr->p_vaddr + phdr->p_memsz) + load_bias; in _phdr_table_set_load_prot()
806 int prot = PFLAGS_TO_PROT(phdr->p_flags) | extra_prot_flags; in _phdr_table_set_load_prot()
880 const ElfW(Phdr)* phdr = phdr_table; in _phdr_table_set_gnu_relro_prot()
881 const ElfW(Phdr)* phdr_limit = phdr + phdr_count; in _phdr_table_set_gnu_relro_prot()
883 for (phdr = phdr_table; phdr < phdr_limit; phdr++) { in _phdr_table_set_gnu_relro_prot()
884 if (phdr->p_type != PT_GNU_RELRO) { in _phdr_table_set_gnu_relro_prot()
904 ElfW(Addr) seg_page_start = PAGE_START(phdr->p_vaddr) + load_bias; in _phdr_table_set_gnu_relro_prot()
905 ElfW(Addr) seg_page_end = PAGE_END(phdr->p_vaddr + phdr->p_memsz) + load_bias; in _phdr_table_set_gnu_relro_prot()
956 const ElfW(Phdr)* phdr = phdr_table; in phdr_table_serialize_gnu_relro()
957 const ElfW(Phdr)* phdr_limit = phdr + phdr_count; in phdr_table_serialize_gnu_relro()
959 for (phdr = phdr_table; phdr < phdr_limit; phdr++) { in phdr_table_serialize_gnu_relro()
960 if (phdr->p_type != PT_GNU_RELRO) { in phdr_table_serialize_gnu_relro()
964 ElfW(Addr) seg_page_start = PAGE_START(phdr->p_vaddr) + load_bias; in phdr_table_serialize_gnu_relro()
965 ElfW(Addr) seg_page_end = PAGE_END(phdr->p_vaddr + phdr->p_memsz) + load_bias; in phdr_table_serialize_gnu_relro()
1019 const ElfW(Phdr)* phdr = phdr_table; in phdr_table_map_gnu_relro()
1020 const ElfW(Phdr)* phdr_limit = phdr + phdr_count; in phdr_table_map_gnu_relro()
1022 for (phdr = phdr_table; phdr < phdr_limit; phdr++) { in phdr_table_map_gnu_relro()
1023 if (phdr->p_type != PT_GNU_RELRO) { in phdr_table_map_gnu_relro()
1027 ElfW(Addr) seg_page_start = PAGE_START(phdr->p_vaddr) + load_bias; in phdr_table_map_gnu_relro()
1028 ElfW(Addr) seg_page_end = PAGE_END(phdr->p_vaddr + phdr->p_memsz) + load_bias; in phdr_table_map_gnu_relro()
1099 const ElfW(Phdr)* phdr = phdr_table; in phdr_table_get_arm_exidx()
1100 const ElfW(Phdr)* phdr_limit = phdr + phdr_count; in phdr_table_get_arm_exidx()
1102 for (phdr = phdr_table; phdr < phdr_limit; phdr++) { in phdr_table_get_arm_exidx()
1103 if (phdr->p_type != PT_ARM_EXIDX) { in phdr_table_get_arm_exidx()
1107 *arm_exidx = reinterpret_cast<ElfW(Addr)*>(load_bias + phdr->p_vaddr); in phdr_table_get_arm_exidx()
1108 *arm_exidx_count = phdr->p_memsz / 8; in phdr_table_get_arm_exidx()
1135 const ElfW(Phdr)& phdr = phdr_table[i]; in phdr_table_get_dynamic_section()
1136 if (phdr.p_type == PT_DYNAMIC) { in phdr_table_get_dynamic_section()
1137 *dynamic = reinterpret_cast<ElfW(Dyn)*>(load_bias + phdr.p_vaddr); in phdr_table_get_dynamic_section()
1139 *dynamic_flags = phdr.p_flags; in phdr_table_get_dynamic_section()
1158 const ElfW(Phdr)& phdr = phdr_table[i]; in phdr_table_get_interpreter_name()
1159 if (phdr.p_type == PT_INTERP) { in phdr_table_get_interpreter_name()
1160 return reinterpret_cast<const char*>(load_bias + phdr.p_vaddr); in phdr_table_get_interpreter_name()
1173 for (const ElfW(Phdr)* phdr = phdr_table_; phdr < phdr_limit; ++phdr) { in FindPhdr()
1174 if (phdr->p_type == PT_PHDR) { in FindPhdr()
1175 return CheckPhdr(load_bias_ + phdr->p_vaddr); in FindPhdr()
1182 for (const ElfW(Phdr)* phdr = phdr_table_; phdr < phdr_limit; ++phdr) { in FindPhdr()
1183 if (phdr->p_type == PT_LOAD) { in FindPhdr()
1184 if (phdr->p_offset == 0) { in FindPhdr()
1185 ElfW(Addr) elf_addr = load_bias_ + phdr->p_vaddr; in FindPhdr()
1213 for (const ElfW(Phdr)* phdr = phdr_table_; phdr < phdr_limit; ++phdr) { in CheckPhdr()
1214 if (phdr->p_type != PT_LOAD) { in CheckPhdr()
1217 ElfW(Addr) seg_start = phdr->p_vaddr + load_bias_; in CheckPhdr()
1218 ElfW(Addr) seg_end = phdr->p_filesz + seg_start; in CheckPhdr()