Lines Matching defs:Phdr
1782 std::pair<const typename ELFT::Phdr *, const typename ELFT::Shdr *>
1787 for (const Elf_Phdr &Phdr : *PhdrsOrErr) {
1788 if (Phdr.p_type != ELF::PT_DYNAMIC)
1790 DynamicPhdr = &Phdr;
4669 static bool checkTLSSections(const typename ELFT::Phdr &Phdr,
4674 return Phdr.p_type == ELF::PT_TLS;
4678 return (Phdr.p_type == ELF::PT_TLS) || (Phdr.p_type == ELF::PT_LOAD) ||
4679 (Phdr.p_type == ELF::PT_GNU_RELRO);
4683 return Phdr.p_type != ELF::PT_TLS;
4687 static bool checkPTDynamic(const typename ELFT::Phdr &Phdr,
4689 if (Phdr.p_type != ELF::PT_DYNAMIC || Phdr.p_memsz == 0 || Sec.sh_size != 0)
4696 (Sec.sh_offset > Phdr.p_offset &&
4697 Sec.sh_offset < Phdr.p_offset + Phdr.p_filesz);
4699 (Sec.sh_addr > Phdr.p_vaddr && Sec.sh_addr < Phdr.p_memsz);
4752 for (const Elf_Phdr &Phdr : *PhdrsOrErr) {
4753 Fields[0].Str = getGNUPtType(Header.e_machine, Phdr.p_type);
4754 Fields[1].Str = to_string(format_hex(Phdr.p_offset, 8));
4755 Fields[2].Str = to_string(format_hex(Phdr.p_vaddr, Width));
4756 Fields[3].Str = to_string(format_hex(Phdr.p_paddr, Width));
4757 Fields[4].Str = to_string(format_hex(Phdr.p_filesz, SizeWidth));
4758 Fields[5].Str = to_string(format_hex(Phdr.p_memsz, SizeWidth));
4759 Fields[6].Str = printPhdrFlags(Phdr.p_flags);
4760 Fields[7].Str = to_string(format_hex(Phdr.p_align, 1));
4763 if (Phdr.p_type == ELF::PT_INTERP) {
4768 Twine::utohexstr(Phdr.p_offset) + ": " + Msg);
4771 if (Phdr.p_offset >= this->Obj.getBufSize()) {
4778 reinterpret_cast<const char *>(this->Obj.base()) + Phdr.p_offset;
4779 size_t MaxSize = this->Obj.getBufSize() - Phdr.p_offset;
4806 for (const Elf_Phdr &Phdr : *PhdrsOrErr) {
4817 if (isSectionInSegment<ELFT>(Phdr, Sec) &&
4818 checkTLSSections<ELFT>(Phdr, Sec) &&
4819 checkPTDynamic<ELFT>(Phdr, Sec)) {
6154 Expected<ArrayRef<typename ELFT::Phdr>> PhdrsOrErr = Obj.program_headers();
6163 const typename ELFT::Phdr &P = (*PhdrsOrErr)[I];
7560 for (const Elf_Phdr &Phdr : *PhdrsOrErr) {
7563 segmentTypeToString(this->Obj.getHeader().e_machine, Phdr.p_type);
7565 W.printHex("Type", Type.empty() ? "Unknown" : Type, Phdr.p_type);
7566 W.printHex("Offset", Phdr.p_offset);
7567 W.printHex("VirtualAddress", Phdr.p_vaddr);
7568 W.printHex("PhysicalAddress", Phdr.p_paddr);
7569 W.printNumber("FileSize", Phdr.p_filesz);
7570 W.printNumber("MemSize", Phdr.p_memsz);
7571 W.printFlags("Flags", Phdr.p_flags, ArrayRef(ElfSegmentFlags));
7572 W.printNumber("Alignment", Phdr.p_align);