Lines Matching refs:Sec
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);
363 void printRelocations(const Elf_Shdr *Sec, const ELFO *Obj);
497 const typename ELFO::Elf_Shdr *Sec, in printVersionSymbolSection() argument
500 if (!Sec) in printVersionSymbolSection()
502 StringRef Name = unwrapOrError(Obj->getSectionName(Sec)); in printVersionSymbolSection()
503 W.printNumber("Section Name", Name, Sec->sh_name); in printVersionSymbolSection()
504 W.printHex("Address", Sec->sh_addr); in printVersionSymbolSection()
505 W.printHex("Offset", Sec->sh_offset); in printVersionSymbolSection()
506 W.printNumber("Link", Sec->sh_link); in printVersionSymbolSection()
508 const uint8_t *P = (const uint8_t *)Obj->base() + Sec->sh_offset; in printVersionSymbolSection()
531 const typename ELFO::Elf_Shdr *Sec, in printVersionDefinitionSection() argument
537 if (!Sec) in printVersionDefinitionSection()
548 (const uint8_t *)Obj->base() + Sec->sh_offset; in printVersionDefinitionSection()
549 const uint8_t *SecEndAddress = SecStartAddress + Sec->sh_size; in printVersionDefinitionSection()
552 unwrapOrError(Obj->getSection(Sec->sh_link)); in printVersionDefinitionSection()
587 const typename ELFO::Elf_Shdr *Sec, in printVersionDependencySection() argument
593 if (!Sec) in printVersionDependencySection()
601 const uint8_t *SecData = (const uint8_t *)Obj->base() + Sec->sh_offset; in printVersionDependencySection()
603 unwrapOrError(Obj->getSection(Sec->sh_link)); in printVersionDependencySection()
731 const typename ELFO::Elf_Shdr *Sec = in getSectionNameIndex() local
733 SectionName = unwrapOrError(Obj.getSectionName(Sec)); in getSectionNameIndex()
1321 for (const Elf_Shdr &Sec : Obj->sections()) { in ELFDumper() local
1322 switch (Sec.sh_type) { in ELFDumper()
1326 DotSymtabSec = &Sec; in ELFDumper()
1331 DynSymRegion = createDRIFrom(&Sec); in ELFDumper()
1333 DynSymtabName = unwrapOrError(Obj->getSectionName(&Sec)); in ELFDumper()
1336 ShndxTable = unwrapOrError(Obj->getSHNDXTable(Sec)); in ELFDumper()
1341 dot_gnu_version_sec = &Sec; in ELFDumper()
1346 dot_gnu_version_d_sec = &Sec; in ELFDumper()
1351 dot_gnu_version_r_sec = &Sec; in ELFDumper()
1854 for (const ELFO::Elf_Shdr &Sec : Obj->sections()) { in printAttributes() local
1855 if (Sec.sh_type != ELF::SHT_ARM_ATTRIBUTES) in printAttributes()
1858 ArrayRef<uint8_t> Contents = unwrapOrError(Obj->getSectionContents(&Sec)); in printAttributes()
2252 ArrayRef<uint8_t> Sec = unwrapOrError(Obj->getSectionContents(Shdr)); in printMipsABIFlags() local
2253 if (Sec.size() != sizeof(Elf_Mips_ABIFlags<ELFT>)) { in printMipsABIFlags()
2258 auto *Flags = reinterpret_cast<const Elf_Mips_ABIFlags<ELFT> *>(Sec.data()); in printMipsABIFlags()
2297 ArrayRef<uint8_t> Sec = unwrapOrError(Obj->getSectionContents(Shdr)); in printMipsReginfo() local
2298 if (Sec.size() != sizeof(Elf_Mips_RegInfo<ELFT>)) { in printMipsReginfo()
2304 auto *Reginfo = reinterpret_cast<const Elf_Mips_RegInfo<ELFT> *>(Sec.data()); in printMipsReginfo()
2317 ArrayRef<uint8_t> Sec = unwrapOrError(Obj->getSectionContents(Shdr)); in printMipsOptions() local
2318 while (!Sec.empty()) { in printMipsOptions()
2319 if (Sec.size() < sizeof(Elf_Mips_Options<ELFT>)) { in printMipsOptions()
2323 auto *O = reinterpret_cast<const Elf_Mips_Options<ELFT> *>(Sec.data()); in printMipsOptions()
2333 Sec = Sec.slice(O->size); in printMipsOptions()
2339 for (const auto &Sec : Obj->sections()) { in printStackMap() local
2340 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec)); in printStackMap()
2342 StackMapSection = &Sec; in printStackMap()
2426 for (const Elf_Shdr &Sec : Obj->sections()) { in printGroupSections() local
2427 if (Sec.sh_type == ELF::SHT_GROUP) { in printGroupSections()
2429 const Elf_Shdr *Symtab = unwrapOrError(Obj->getSection(Sec.sh_link)); in printGroupSections()
2432 Obj->template getEntry<Elf_Sym>(Symtab, Sec.sh_info); in printGroupSections()
2434 Obj->template getSectionContentsAsArray<Elf_Word>(&Sec)); in printGroupSections()
2435 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec)); in printGroupSections()
2442 auto Sec = unwrapOrError(Obj->getSection(Ndx)); in printGroupSections() local
2443 const StringRef Name = unwrapOrError(Obj->getSectionName(Sec)); in printGroupSections()
2471 const Elf_Shdr *Sec = unwrapOrError( in printRelocation() local
2473 TargetName = unwrapOrError(Obj->getSectionName(Sec)); in printRelocation()
2520 for (const Elf_Shdr &Sec : Obj->sections()) { in printRelocations() local
2521 if (Sec.sh_type != ELF::SHT_REL && Sec.sh_type != ELF::SHT_RELA) in printRelocations()
2524 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec)); in printRelocations()
2525 unsigned Entries = Sec.getEntityCount(); in printRelocations()
2526 uintX_t Offset = Sec.sh_offset; in printRelocations()
2530 printRelocHeader(OS, ELFT::Is64Bits, (Sec.sh_type == ELF::SHT_RELA)); in printRelocations()
2531 const Elf_Shdr *SymTab = unwrapOrError(Obj->getSection(Sec.sh_link)); in printRelocations()
2532 if (Sec.sh_type == ELF::SHT_REL) { in printRelocations()
2533 for (const auto &R : Obj->rels(&Sec)) { in printRelocations()
2541 for (const auto &R : Obj->relas(&Sec)) in printRelocations()
2666 for (const Elf_Shdr &Sec : Obj->sections()) { in printSections() local
2669 Fields[1].Str = unwrapOrError(Obj->getSectionName(&Sec)); in printSections()
2670 Type = getSectionTypeString(Obj->getHeader()->e_machine, Sec.sh_type); in printSections()
2672 Address = to_string(format_hex_no_prefix(Sec.sh_addr, Width)); in printSections()
2674 Offset = to_string(format_hex_no_prefix(Sec.sh_offset, 6)); in printSections()
2676 Size = to_string(format_hex_no_prefix(Sec.sh_size, 6)); in printSections()
2678 EntrySize = to_string(format_hex_no_prefix(Sec.sh_entsize, 2)); in printSections()
2680 Flags = getGNUFlags(Sec.sh_flags); in printSections()
2682 Link = to_string(Sec.sh_link); in printSections()
2684 Info = to_string(Sec.sh_info); in printSections()
2686 Alignment = to_string(Sec.sh_addralign); in printSections()
2837 const Elf_Shdr &Sec) { in checkTLSSections() argument
2838 return (((Sec.sh_flags & ELF::SHF_TLS) && in checkTLSSections()
2841 (!(Sec.sh_flags & ELF::SHF_TLS) && Phdr.p_type != ELF::PT_TLS)); in checkTLSSections()
2847 bool GNUStyle<ELFT>::checkoffsets(const Elf_Phdr &Phdr, const Elf_Shdr &Sec) { in checkoffsets() argument
2848 if (Sec.sh_type == ELF::SHT_NOBITS) in checkoffsets()
2851 (Sec.sh_type == ELF::SHT_NOBITS) && ((Sec.sh_flags & ELF::SHF_TLS) != 0); in checkoffsets()
2854 (IsSpecial && Phdr.p_type != ELF::PT_TLS) ? 0 : Sec.sh_size; in checkoffsets()
2855 if (Sec.sh_offset >= Phdr.p_offset) in checkoffsets()
2856 return ((Sec.sh_offset + SectionSize <= Phdr.p_filesz + Phdr.p_offset) in checkoffsets()
2858 (Sec.sh_offset + 1 <= Phdr.p_offset + Phdr.p_filesz)); in checkoffsets()
2865 bool GNUStyle<ELFT>::checkVMA(const Elf_Phdr &Phdr, const Elf_Shdr &Sec) { in checkVMA() argument
2866 if (!(Sec.sh_flags & ELF::SHF_ALLOC)) in checkVMA()
2869 (Sec.sh_type == ELF::SHT_NOBITS) && ((Sec.sh_flags & ELF::SHF_TLS) != 0); in checkVMA()
2872 (IsSpecial && Phdr.p_type != ELF::PT_TLS) ? 0 : Sec.sh_size; in checkVMA()
2873 if (Sec.sh_addr >= Phdr.p_vaddr) in checkVMA()
2874 return ((Sec.sh_addr + SectionSize <= Phdr.p_vaddr + Phdr.p_memsz) && in checkVMA()
2875 (Sec.sh_addr + 1 <= Phdr.p_vaddr + Phdr.p_memsz)); in checkVMA()
2881 bool GNUStyle<ELFT>::checkPTDynamic(const Elf_Phdr &Phdr, const Elf_Shdr &Sec) { in checkPTDynamic() argument
2882 if (Phdr.p_type != ELF::PT_DYNAMIC || Sec.sh_size != 0 || Phdr.p_memsz == 0) in checkPTDynamic()
2885 return ((Sec.sh_type == ELF::SHT_NOBITS) || in checkPTDynamic()
2886 (Sec.sh_offset > Phdr.p_offset && in checkPTDynamic()
2887 Sec.sh_offset < Phdr.p_offset + Phdr.p_filesz)) && in checkPTDynamic()
2888 (!(Sec.sh_flags & ELF::SHF_ALLOC) || in checkPTDynamic()
2889 (Sec.sh_addr > Phdr.p_vaddr && Sec.sh_addr < Phdr.p_memsz)); in checkPTDynamic()
2944 for (const Elf_Shdr &Sec : Obj->sections()) { in printProgramHeaders() local
2949 bool TbssInNonTLS = (Sec.sh_type == ELF::SHT_NOBITS) && in printProgramHeaders()
2950 ((Sec.sh_flags & ELF::SHF_TLS) != 0) && in printProgramHeaders()
2952 if (!TbssInNonTLS && checkTLSSections(Phdr, Sec) && in printProgramHeaders()
2953 checkoffsets(Phdr, Sec) && checkVMA(Phdr, Sec) && in printProgramHeaders()
2954 checkPTDynamic(Phdr, Sec) && (Sec.sh_type != ELF::SHT_NULL)) in printProgramHeaders()
2955 Sections += unwrapOrError(Obj->getSectionName(&Sec)).str() + " "; in printProgramHeaders()
3212 for (const Elf_Shdr &Sec : Obj->sections()) { in printGroupSections() local
3213 if (Sec.sh_type == ELF::SHT_GROUP) { in printGroupSections()
3215 const Elf_Shdr *Symtab = unwrapOrError(Obj->getSection(Sec.sh_link)); in printGroupSections()
3217 const Elf_Sym *Sym = Obj->template getEntry<Elf_Sym>(Symtab, Sec.sh_info); in printGroupSections()
3219 Obj->template getSectionContentsAsArray<Elf_Word>(&Sec)); in printGroupSections()
3221 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec)); in printGroupSections()
3222 W.printNumber("Name", Name, Sec.sh_name); in printGroupSections()
3230 auto Sec = unwrapOrError(Obj->getSection(Data[Member])); in printGroupSections() local
3231 const StringRef Name = unwrapOrError(Obj->getSectionName(Sec)); in printGroupSections()
3246 for (const Elf_Shdr &Sec : Obj->sections()) { in printRelocations() local
3249 if (Sec.sh_type != ELF::SHT_REL && Sec.sh_type != ELF::SHT_RELA) in printRelocations()
3252 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec)); in printRelocations()
3257 printRelocations(&Sec, Obj); in printRelocations()
3265 void LLVMStyle<ELFT>::printRelocations(const Elf_Shdr *Sec, const ELFO *Obj) { in printRelocations() argument
3266 const Elf_Shdr *SymTab = unwrapOrError(Obj->getSection(Sec->sh_link)); in printRelocations()
3268 switch (Sec->sh_type) { in printRelocations()
3270 for (const Elf_Rel &R : Obj->rels(Sec)) { in printRelocations()
3279 for (const Elf_Rela &R : Obj->relas(Sec)) in printRelocations()
3293 const Elf_Shdr *Sec = unwrapOrError( in printRelocation() local
3295 TargetName = unwrapOrError(Obj->getSectionName(Sec)); in printRelocation()
3320 for (const Elf_Shdr &Sec : Obj->sections()) { in printSections() local
3323 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec)); in printSections()
3327 W.printNumber("Name", Name, Sec.sh_name); in printSections()
3329 getElfSectionType(Obj->getHeader()->e_machine, Sec.sh_type), in printSections()
3330 Sec.sh_type); in printSections()
3359 W.printFlags("Flags", Sec.sh_flags, makeArrayRef(SectionFlags)); in printSections()
3360 W.printHex("Address", Sec.sh_addr); in printSections()
3361 W.printHex("Offset", Sec.sh_offset); in printSections()
3362 W.printNumber("Size", Sec.sh_size); in printSections()
3363 W.printNumber("Link", Sec.sh_link); in printSections()
3364 W.printNumber("Info", Sec.sh_info); in printSections()
3365 W.printNumber("AddressAlignment", Sec.sh_addralign); in printSections()
3366 W.printNumber("EntrySize", Sec.sh_entsize); in printSections()
3370 printRelocations(&Sec, Obj); in printSections()
3381 if (SymSec == &Sec) in printSections()
3386 if (opts::SectionData && Sec.sh_type != ELF::SHT_NOBITS) { in printSections()
3387 ArrayRef<uint8_t> Data = unwrapOrError(Obj->getSectionContents(&Sec)); in printSections()