Home | History | Annotate | Download | only in llvm-readobj

Lines Matching refs:Phdr

348   bool checkTLSSections(const Elf_Phdr &Phdr, const Elf_Shdr &Sec);
349 bool checkoffsets(const Elf_Phdr &Phdr, const Elf_Shdr &Sec);
350 bool checkVMA(const Elf_Phdr &Phdr, const Elf_Shdr &Sec);
351 bool checkPTDynamic(const Elf_Phdr &Phdr, const Elf_Shdr &Sec);
1311 for (const Elf_Phdr &Phdr : Obj->program_headers()) {
1312 if (Phdr.p_type == ELF::PT_DYNAMIC) {
1313 DynamicTable = createDRIFrom(&Phdr, sizeof(Elf_Dyn));
1316 if (Phdr.p_type != ELF::PT_LOAD || Phdr.p_filesz == 0)
1318 LoadSegments.push_back(&Phdr);
1373 const Elf_Phdr &Phdr = **I;
1374 uint64_t Delta = VAddr - Phdr.p_vaddr;
1375 if (Delta >= Phdr.p_filesz)
1377 return Obj->base() + Phdr.p_offset + Delta;
2836 bool GNUStyle<ELFT>::checkTLSSections(const Elf_Phdr &Phdr,
2839 ((Phdr.p_type == ELF::PT_TLS) || (Phdr.p_type == ELF::PT_LOAD) ||
2840 (Phdr.p_type == ELF::PT_GNU_RELRO))) ||
2841 (!(Sec.sh_flags & ELF::SHF_TLS) && Phdr.p_type != ELF::PT_TLS));
2847 bool GNUStyle<ELFT>::checkoffsets(const Elf_Phdr &Phdr, const Elf_Shdr &Sec) {
2854 (IsSpecial && Phdr.p_type != ELF::PT_TLS) ? 0 : Sec.sh_size;
2855 if (Sec.sh_offset >= Phdr.p_offset)
2856 return ((Sec.sh_offset + SectionSize <= Phdr.p_filesz + Phdr.p_offset)
2858 (Sec.sh_offset + 1 <= Phdr.p_offset + Phdr.p_filesz));
2865 bool GNUStyle<ELFT>::checkVMA(const Elf_Phdr &Phdr, const Elf_Shdr &Sec) {
2872 (IsSpecial && Phdr.p_type != ELF::PT_TLS) ? 0 : Sec.sh_size;
2873 if (Sec.sh_addr >= Phdr.p_vaddr)
2874 return ((Sec.sh_addr + SectionSize <= Phdr.p_vaddr + Phdr.p_memsz) &&
2875 (Sec.sh_addr + 1 <= Phdr.p_vaddr + Phdr.p_memsz));
2881 bool GNUStyle<ELFT>::checkPTDynamic(const Elf_Phdr &Phdr, const Elf_Shdr &Sec) {
2882 if (Phdr.p_type != ELF::PT_DYNAMIC || Sec.sh_size != 0 || Phdr.p_memsz == 0)
2884 // Is section within the phdr both based on offset and VMA ?
2886 (Sec.sh_offset > Phdr.p_offset &&
2887 Sec.sh_offset < Phdr.p_offset + Phdr.p_filesz)) &&
2889 (Sec.sh_addr > Phdr.p_vaddr && Sec.sh_addr < Phdr.p_memsz));
2914 for (const auto &Phdr : Obj->program_headers()) {
2915 Type = getElfPtType(Header->e_machine, Phdr.p_type);
2916 Offset = to_string(format_hex(Phdr.p_offset, 8));
2917 VMA = to_string(format_hex(Phdr.p_vaddr, Width));
2918 LMA = to_string(format_hex(Phdr.p_paddr, Width));
2919 FileSz = to_string(format_hex(Phdr.p_filesz, SizeWidth));
2920 MemSz = to_string(format_hex(Phdr.p_memsz, SizeWidth));
2921 Flag = printPhdrFlags(Phdr.p_flags);
2922 Align = to_string(format_hex(Phdr.p_align, 1));
2933 if (Phdr.p_type == ELF::PT_INTERP) {
2935 OS << reinterpret_cast<const char *>(Obj->base()) + Phdr.p_offset << "]";
2941 for (const Elf_Phdr &Phdr : Obj->program_headers()) {
2951 Phdr.p_type != ELF::PT_TLS;
2952 if (!TbssInNonTLS && checkTLSSections(Phdr, Sec) &&
2953 checkoffsets(Phdr, Sec) && checkVMA(Phdr, Sec) &&
2954 checkPTDynamic(Phdr, Sec) && (Sec.sh_type != ELF::SHT_NULL))
3514 for (const Elf_Phdr &Phdr : Obj->program_headers()) {
3517 getElfSegmentType(Obj->getHeader()->e_machine, Phdr.p_type),
3518 Phdr.p_type);
3519 W.printHex("Offset", Phdr.p_offset);
3520 W.printHex("VirtualAddress", Phdr.p_vaddr);
3521 W.printHex("PhysicalAddress", Phdr.p_paddr);
3522 W.printNumber("FileSize", Phdr.p_filesz);
3523 W.printNumber("MemSize", Phdr.p_memsz);
3524 W.printFlags("Flags", Phdr.p_flags, makeArrayRef(ElfSegmentFlags));
3525 W.printNumber("Alignment", Phdr.p_align);