Lines Matching defs:Phdr
1769 std::pair<const typename ELFT::Phdr *, const typename ELFT::Shdr *>
1774 for (const Elf_Phdr &Phdr : *PhdrsOrErr) {
1775 if (Phdr.p_type != ELF::PT_DYNAMIC)
1777 DynamicPhdr = &Phdr;
4653 static bool checkTLSSections(const typename ELFT::Phdr &Phdr,
4658 return Phdr.p_type == ELF::PT_TLS;
4662 return (Phdr.p_type == ELF::PT_TLS) || (Phdr.p_type == ELF::PT_LOAD) ||
4663 (Phdr.p_type == ELF::PT_GNU_RELRO);
4667 return Phdr.p_type != ELF::PT_TLS;
4671 static bool checkPTDynamic(const typename ELFT::Phdr &Phdr,
4673 if (Phdr.p_type != ELF::PT_DYNAMIC || Phdr.p_memsz == 0 || Sec.sh_size != 0)
4680 (Sec.sh_offset > Phdr.p_offset &&
4681 Sec.sh_offset < Phdr.p_offset + Phdr.p_filesz);
4683 (Sec.sh_addr > Phdr.p_vaddr && Sec.sh_addr < Phdr.p_memsz);
4736 for (const Elf_Phdr &Phdr : *PhdrsOrErr) {
4737 Fields[0].Str = getGNUPtType(Header.e_machine, Phdr.p_type);
4738 Fields[1].Str = to_string(format_hex(Phdr.p_offset, 8));
4739 Fields[2].Str = to_string(format_hex(Phdr.p_vaddr, Width));
4740 Fields[3].Str = to_string(format_hex(Phdr.p_paddr, Width));
4741 Fields[4].Str = to_string(format_hex(Phdr.p_filesz, SizeWidth));
4742 Fields[5].Str = to_string(format_hex(Phdr.p_memsz, SizeWidth));
4743 Fields[6].Str = printPhdrFlags(Phdr.p_flags);
4744 Fields[7].Str = to_string(format_hex(Phdr.p_align, 1));
4747 if (Phdr.p_type == ELF::PT_INTERP) {
4752 Twine::utohexstr(Phdr.p_offset) + ": " + Msg);
4755 if (Phdr.p_offset >= this->Obj.getBufSize()) {
4762 reinterpret_cast<const char *>(this->Obj.base()) + Phdr.p_offset;
4763 size_t MaxSize = this->Obj.getBufSize() - Phdr.p_offset;
4790 for (const Elf_Phdr &Phdr : *PhdrsOrErr) {
4801 if (isSectionInSegment<ELFT>(Phdr, Sec) &&
4802 checkTLSSections<ELFT>(Phdr, Sec) &&
4803 checkPTDynamic<ELFT>(Phdr, Sec)) {
6128 Expected<ArrayRef<typename ELFT::Phdr>> PhdrsOrErr = Obj.program_headers();
6137 const typename ELFT::Phdr &P = (*PhdrsOrErr)[I];
7531 for (const Elf_Phdr &Phdr : *PhdrsOrErr) {
7534 segmentTypeToString(this->Obj.getHeader().e_machine, Phdr.p_type);
7536 W.printHex("Type", Type.empty() ? "Unknown" : Type, Phdr.p_type);
7537 W.printHex("Offset", Phdr.p_offset);
7538 W.printHex("VirtualAddress", Phdr.p_vaddr);
7539 W.printHex("PhysicalAddress", Phdr.p_paddr);
7540 W.printNumber("FileSize", Phdr.p_filesz);
7541 W.printNumber("MemSize", Phdr.p_memsz);
7542 W.printFlags("Flags", Phdr.p_flags, ArrayRef(ElfSegmentFlags));
7543 W.printNumber("Alignment", Phdr.p_align);