Lines Matching refs:Sec

441   bool checkTLSSections(const Elf_Phdr &Phdr, const Elf_Shdr &Sec);
442 bool checkoffsets(const Elf_Phdr &Phdr, const Elf_Shdr &Sec);
443 bool checkVMA(const Elf_Phdr &Phdr, const Elf_Shdr &Sec);
444 bool checkPTDynamic(const Elf_Phdr &Phdr, const Elf_Shdr &Sec);
457 void printRelocations(const Elf_Shdr *Sec, const ELFO *Obj);
598 const typename ELFO::Elf_Shdr *Sec, in printVersionSymbolSection() argument
601 if (!Sec) in printVersionSymbolSection()
603 StringRef Name = unwrapOrError(Obj->getSectionName(Sec)); in printVersionSymbolSection()
604 W.printNumber("Section Name", Name, Sec->sh_name); in printVersionSymbolSection()
605 W.printHex("Address", Sec->sh_addr); in printVersionSymbolSection()
606 W.printHex("Offset", Sec->sh_offset); in printVersionSymbolSection()
607 W.printNumber("Link", Sec->sh_link); in printVersionSymbolSection()
609 const uint8_t *P = (const uint8_t *)Obj->base() + Sec->sh_offset; in printVersionSymbolSection()
632 const typename ELFO::Elf_Shdr *Sec, in printVersionDefinitionSection() argument
638 if (!Sec) in printVersionDefinitionSection()
652 (const uint8_t *)Obj->base() + Sec->sh_offset; in printVersionDefinitionSection()
653 const uint8_t *SecEndAddress = SecStartAddress + Sec->sh_size; in printVersionDefinitionSection()
656 unwrapOrError(Obj->getSection(Sec->sh_link)); in printVersionDefinitionSection()
691 const typename ELFO::Elf_Shdr *Sec, in printVersionDependencySection() argument
697 if (!Sec) in printVersionDependencySection()
708 const uint8_t *SecData = (const uint8_t *)Obj->base() + Sec->sh_offset; in printVersionDependencySection()
710 unwrapOrError(Obj->getSection(Sec->sh_link)); in printVersionDependencySection()
851 const typename ELFT::Shdr *Sec = in getSectionNameIndex() local
853 SectionName = unwrapOrError(Obj->getSectionName(Sec)); in getSectionNameIndex()
1438 for (const Elf_Shdr &Sec : unwrapOrError(Obj->sections())) { in ELFDumper() local
1439 switch (Sec.sh_type) { in ELFDumper()
1443 DotSymtabSec = &Sec; in ELFDumper()
1448 DynSymRegion = createDRIFrom(&Sec); in ELFDumper()
1450 DynSymtabName = unwrapOrError(Obj->getSectionName(&Sec)); in ELFDumper()
1451 DynamicStringTable = unwrapOrError(Obj->getStringTableForSymtab(Sec)); in ELFDumper()
1454 ShndxTable = unwrapOrError(Obj->getSHNDXTable(Sec)); in ELFDumper()
1459 dot_gnu_version_sec = &Sec; in ELFDumper()
1464 dot_gnu_version_d_sec = &Sec; in ELFDumper()
1469 dot_gnu_version_r_sec = &Sec; in ELFDumper()
1474 DotCGProfileSec = &Sec; in ELFDumper()
1479 DotAddrsigSec = &Sec; in ELFDumper()
2014 for (const ELFO::Elf_Shdr &Sec : unwrapOrError(Obj->sections())) { in printAttributes() local
2015 if (Sec.sh_type != ELF::SHT_ARM_ATTRIBUTES) in printAttributes()
2018 ArrayRef<uint8_t> Contents = unwrapOrError(Obj->getSectionContents(&Sec)); in printAttributes()
2384 ArrayRef<uint8_t> Sec = unwrapOrError(Obj->getSectionContents(Shdr)); in printMipsABIFlags() local
2385 if (Sec.size() != sizeof(Elf_Mips_ABIFlags<ELFT>)) { in printMipsABIFlags()
2390 auto *Flags = reinterpret_cast<const Elf_Mips_ABIFlags<ELFT> *>(Sec.data()); in printMipsABIFlags()
2430 ArrayRef<uint8_t> Sec = unwrapOrError(Obj->getSectionContents(Shdr)); in printMipsReginfo() local
2431 if (Sec.size() != sizeof(Elf_Mips_RegInfo<ELFT>)) { in printMipsReginfo()
2437 auto *Reginfo = reinterpret_cast<const Elf_Mips_RegInfo<ELFT> *>(Sec.data()); in printMipsReginfo()
2451 ArrayRef<uint8_t> Sec = unwrapOrError(Obj->getSectionContents(Shdr)); in printMipsOptions() local
2452 while (!Sec.empty()) { in printMipsOptions()
2453 if (Sec.size() < sizeof(Elf_Mips_Options<ELFT>)) { in printMipsOptions()
2457 auto *O = reinterpret_cast<const Elf_Mips_Options<ELFT> *>(Sec.data()); in printMipsOptions()
2467 Sec = Sec.slice(O->size); in printMipsOptions()
2474 for (const auto &Sec : unwrapOrError(Obj->sections())) { in printStackMap() local
2475 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec)); in printStackMap()
2477 StackMapSection = &Sec; in printStackMap()
2619 for (const Elf_Shdr &Sec : unwrapOrError(Obj->sections())) { in getGroups() local
2621 if (Sec.sh_type != ELF::SHT_GROUP) in getGroups()
2624 const Elf_Shdr *Symtab = unwrapOrError(Obj->getSection(Sec.sh_link)); in getGroups()
2627 unwrapOrError(Obj->template getEntry<Elf_Sym>(Symtab, Sec.sh_info)); in getGroups()
2629 unwrapOrError(Obj->template getSectionContentsAsArray<Elf_Word>(&Sec)); in getGroups()
2631 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec)); in getGroups()
2635 Sec.sh_name, in getGroups()
2637 Sec.sh_link, in getGroups()
2638 Sec.sh_info, in getGroups()
2644 auto Sec = unwrapOrError(Obj->getSection(Ndx)); in getGroups() local
2645 const StringRef Name = unwrapOrError(Obj->getSectionName(Sec)); in getGroups()
2707 const Elf_Shdr *Sec = unwrapOrError( in printRelocation() local
2709 TargetName = unwrapOrError(Obj->getSectionName(Sec)); in printRelocation()
2766 for (const Elf_Shdr &Sec : unwrapOrError(Obj->sections())) { in printRelocations() local
2767 if (Sec.sh_type != ELF::SHT_REL && in printRelocations()
2768 Sec.sh_type != ELF::SHT_RELA && in printRelocations()
2769 Sec.sh_type != ELF::SHT_RELR && in printRelocations()
2770 Sec.sh_type != ELF::SHT_ANDROID_REL && in printRelocations()
2771 Sec.sh_type != ELF::SHT_ANDROID_RELA && in printRelocations()
2772 Sec.sh_type != ELF::SHT_ANDROID_RELR) in printRelocations()
2775 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec)); in printRelocations()
2776 unsigned Entries = Sec.getEntityCount(); in printRelocations()
2778 if (Sec.sh_type == ELF::SHT_ANDROID_REL || in printRelocations()
2779 Sec.sh_type == ELF::SHT_ANDROID_RELA) { in printRelocations()
2782 AndroidRelas = unwrapOrError(Obj->android_relas(&Sec)); in printRelocations()
2786 if (!opts::RawRelr && (Sec.sh_type == ELF::SHT_RELR || in printRelocations()
2787 Sec.sh_type == ELF::SHT_ANDROID_RELR)) { in printRelocations()
2790 Elf_Relr_Range Relrs = unwrapOrError(Obj->relrs(&Sec)); in printRelocations()
2794 uintX_t Offset = Sec.sh_offset; in printRelocations()
2798 printRelocHeader(Sec.sh_type); in printRelocations()
2799 const Elf_Shdr *SymTab = unwrapOrError(Obj->getSection(Sec.sh_link)); in printRelocations()
2800 switch (Sec.sh_type) { in printRelocations()
2802 for (const auto &R : unwrapOrError(Obj->rels(&Sec))) { in printRelocations()
2811 for (const auto &R : unwrapOrError(Obj->relas(&Sec))) in printRelocations()
2817 for (const auto &R : unwrapOrError(Obj->relrs(&Sec))) in printRelocations()
2827 printRelocation(Obj, SymTab, R, Sec.sh_type == ELF::SHT_ANDROID_RELA); in printRelocations()
2972 for (const Elf_Shdr &Sec : Sections) { in printSectionHeaders() local
2975 Fields[1].Str = unwrapOrError(Obj->getSectionName(&Sec)); in printSectionHeaders()
2976 Type = getSectionTypeString(Obj->getHeader()->e_machine, Sec.sh_type); in printSectionHeaders()
2978 Address = to_string(format_hex_no_prefix(Sec.sh_addr, Width)); in printSectionHeaders()
2980 Offset = to_string(format_hex_no_prefix(Sec.sh_offset, 6)); in printSectionHeaders()
2982 Size = to_string(format_hex_no_prefix(Sec.sh_size, 6)); in printSectionHeaders()
2984 EntrySize = to_string(format_hex_no_prefix(Sec.sh_entsize, 2)); in printSectionHeaders()
2986 Flags = getGNUFlags(Sec.sh_flags); in printSectionHeaders()
2988 Link = to_string(Sec.sh_link); in printSectionHeaders()
2990 Info = to_string(Sec.sh_info); in printSectionHeaders()
2992 Alignment = to_string(Sec.sh_addralign); in printSectionHeaders()
3249 const Elf_Shdr &Sec) { in checkTLSSections() argument
3250 return (((Sec.sh_flags & ELF::SHF_TLS) && in checkTLSSections()
3253 (!(Sec.sh_flags & ELF::SHF_TLS) && Phdr.p_type != ELF::PT_TLS)); in checkTLSSections()
3259 bool GNUStyle<ELFT>::checkoffsets(const Elf_Phdr &Phdr, const Elf_Shdr &Sec) { in checkoffsets() argument
3260 if (Sec.sh_type == ELF::SHT_NOBITS) in checkoffsets()
3263 (Sec.sh_type == ELF::SHT_NOBITS) && ((Sec.sh_flags & ELF::SHF_TLS) != 0); in checkoffsets()
3266 (IsSpecial && Phdr.p_type != ELF::PT_TLS) ? 0 : Sec.sh_size; in checkoffsets()
3267 if (Sec.sh_offset >= Phdr.p_offset) in checkoffsets()
3268 return ((Sec.sh_offset + SectionSize <= Phdr.p_filesz + Phdr.p_offset) in checkoffsets()
3270 (Sec.sh_offset + 1 <= Phdr.p_offset + Phdr.p_filesz)); in checkoffsets()
3277 bool GNUStyle<ELFT>::checkVMA(const Elf_Phdr &Phdr, const Elf_Shdr &Sec) { in checkVMA() argument
3278 if (!(Sec.sh_flags & ELF::SHF_ALLOC)) in checkVMA()
3281 (Sec.sh_type == ELF::SHT_NOBITS) && ((Sec.sh_flags & ELF::SHF_TLS) != 0); in checkVMA()
3284 (IsSpecial && Phdr.p_type != ELF::PT_TLS) ? 0 : Sec.sh_size; in checkVMA()
3285 if (Sec.sh_addr >= Phdr.p_vaddr) in checkVMA()
3286 return ((Sec.sh_addr + SectionSize <= Phdr.p_vaddr + Phdr.p_memsz) && in checkVMA()
3287 (Sec.sh_addr + 1 <= Phdr.p_vaddr + Phdr.p_memsz)); in checkVMA()
3293 bool GNUStyle<ELFT>::checkPTDynamic(const Elf_Phdr &Phdr, const Elf_Shdr &Sec) { in checkPTDynamic() argument
3294 if (Phdr.p_type != ELF::PT_DYNAMIC || Sec.sh_size != 0 || Phdr.p_memsz == 0) in checkPTDynamic()
3297 return ((Sec.sh_type == ELF::SHT_NOBITS) || in checkPTDynamic()
3298 (Sec.sh_offset > Phdr.p_offset && in checkPTDynamic()
3299 Sec.sh_offset < Phdr.p_offset + Phdr.p_filesz)) && in checkPTDynamic()
3300 (!(Sec.sh_flags & ELF::SHF_ALLOC) || in checkPTDynamic()
3301 (Sec.sh_addr > Phdr.p_vaddr && Sec.sh_addr < Phdr.p_memsz)); in checkPTDynamic()
3356 for (const Elf_Shdr &Sec : unwrapOrError(Obj->sections())) { in printProgramHeaders() local
3361 bool TbssInNonTLS = (Sec.sh_type == ELF::SHT_NOBITS) && in printProgramHeaders()
3362 ((Sec.sh_flags & ELF::SHF_TLS) != 0) && in printProgramHeaders()
3364 if (!TbssInNonTLS && checkTLSSections(Phdr, Sec) && in printProgramHeaders()
3365 checkoffsets(Phdr, Sec) && checkVMA(Phdr, Sec) && in printProgramHeaders()
3366 checkPTDynamic(Phdr, Sec) && (Sec.sh_type != ELF::SHT_NULL)) in printProgramHeaders()
3367 Sections += unwrapOrError(Obj->getSectionName(&Sec)).str() + " "; in printProgramHeaders()
4185 for (const Elf_Shdr &Sec : unwrapOrError(Obj->sections())) { in printRelocations() local
4188 if (Sec.sh_type != ELF::SHT_REL && in printRelocations()
4189 Sec.sh_type != ELF::SHT_RELA && in printRelocations()
4190 Sec.sh_type != ELF::SHT_RELR && in printRelocations()
4191 Sec.sh_type != ELF::SHT_ANDROID_REL && in printRelocations()
4192 Sec.sh_type != ELF::SHT_ANDROID_RELA && in printRelocations()
4193 Sec.sh_type != ELF::SHT_ANDROID_RELR) in printRelocations()
4196 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec)); in printRelocations()
4201 printRelocations(&Sec, Obj); in printRelocations()
4209 void LLVMStyle<ELFT>::printRelocations(const Elf_Shdr *Sec, const ELFO *Obj) { in printRelocations() argument
4210 const Elf_Shdr *SymTab = unwrapOrError(Obj->getSection(Sec->sh_link)); in printRelocations()
4212 switch (Sec->sh_type) { in printRelocations()
4214 for (const Elf_Rel &R : unwrapOrError(Obj->rels(Sec))) { in printRelocations()
4223 for (const Elf_Rela &R : unwrapOrError(Obj->relas(Sec))) in printRelocations()
4228 Elf_Relr_Range Relrs = unwrapOrError(Obj->relrs(Sec)); in printRelocations()
4241 for (const Elf_Rela &R : unwrapOrError(Obj->android_relas(Sec))) in printRelocations()
4255 const Elf_Shdr *Sec = unwrapOrError( in printRelocation() local
4257 TargetName = unwrapOrError(Obj->getSectionName(Sec)); in printRelocation()
4283 for (const Elf_Shdr &Sec : unwrapOrError(Obj->sections())) { in printSectionHeaders() local
4286 StringRef Name = unwrapOrError(Obj->getSectionName(&Sec)); in printSectionHeaders()
4290 W.printNumber("Name", Name, Sec.sh_name); in printSectionHeaders()
4293 object::getELFSectionTypeName(Obj->getHeader()->e_machine, Sec.sh_type), in printSectionHeaders()
4294 Sec.sh_type); in printSectionHeaders()
4323 W.printFlags("Flags", Sec.sh_flags, makeArrayRef(SectionFlags)); in printSectionHeaders()
4324 W.printHex("Address", Sec.sh_addr); in printSectionHeaders()
4325 W.printHex("Offset", Sec.sh_offset); in printSectionHeaders()
4326 W.printNumber("Size", Sec.sh_size); in printSectionHeaders()
4327 W.printNumber("Link", Sec.sh_link); in printSectionHeaders()
4328 W.printNumber("Info", Sec.sh_info); in printSectionHeaders()
4329 W.printNumber("AddressAlignment", Sec.sh_addralign); in printSectionHeaders()
4330 W.printNumber("EntrySize", Sec.sh_entsize); in printSectionHeaders()
4334 printRelocations(&Sec, Obj); in printSectionHeaders()
4345 if (SymSec == &Sec) in printSectionHeaders()
4351 if (opts::SectionData && Sec.sh_type != ELF::SHT_NOBITS) { in printSectionHeaders()
4352 ArrayRef<uint8_t> Data = unwrapOrError(Obj->getSectionContents(&Sec)); in printSectionHeaders()