• Home
  • Raw
  • Download

Lines Matching refs:ELFYAML

59   Expected<std::vector<ELFYAML::ProgramHeader>>
60 dumpProgramHeaders(ArrayRef<std::unique_ptr<ELFYAML::Chunk>> Sections);
63 dumpDWARFSections(std::vector<std::unique_ptr<ELFYAML::Chunk>> &Sections);
66 std::vector<ELFYAML::Symbol> &Symbols);
68 StringRef StrTable, ELFYAML::Symbol &S);
69 Expected<std::vector<std::unique_ptr<ELFYAML::Chunk>>> dumpSections();
70 Error dumpCommonSection(const Elf_Shdr *Shdr, ELFYAML::Section &S);
72 ELFYAML::RelocationSection &S);
75 ELFYAML::Relocation &R);
77 Expected<ELFYAML::AddrsigSection *> dumpAddrsigSection(const Elf_Shdr *Shdr);
78 Expected<ELFYAML::LinkerOptionsSection *>
80 Expected<ELFYAML::DependentLibrariesSection *>
82 Expected<ELFYAML::CallGraphProfileSection *>
84 Expected<ELFYAML::DynamicSection *> dumpDynamicSection(const Elf_Shdr *Shdr);
85 Expected<ELFYAML::RelocationSection *> dumpRelocSection(const Elf_Shdr *Shdr);
86 Expected<ELFYAML::RelrSection *> dumpRelrSection(const Elf_Shdr *Shdr);
87 Expected<ELFYAML::RawContentSection *>
89 Expected<ELFYAML::SymtabShndxSection *>
91 Expected<ELFYAML::NoBitsSection *> dumpNoBitsSection(const Elf_Shdr *Shdr);
92 Expected<ELFYAML::HashSection *> dumpHashSection(const Elf_Shdr *Shdr);
93 Expected<ELFYAML::NoteSection *> dumpNoteSection(const Elf_Shdr *Shdr);
94 Expected<ELFYAML::GnuHashSection *> dumpGnuHashSection(const Elf_Shdr *Shdr);
95 Expected<ELFYAML::VerdefSection *> dumpVerdefSection(const Elf_Shdr *Shdr);
96 Expected<ELFYAML::SymverSection *> dumpSymverSection(const Elf_Shdr *Shdr);
97 Expected<ELFYAML::VerneedSection *> dumpVerneedSection(const Elf_Shdr *Shdr);
98 Expected<ELFYAML::GroupSection *> dumpGroupSection(const Elf_Shdr *Shdr);
99 Expected<ELFYAML::ARMIndexTableSection *>
101 Expected<ELFYAML::MipsABIFlags *> dumpMipsABIFlags(const Elf_Shdr *Shdr);
102 Expected<ELFYAML::StackSizesSection *>
104 Expected<ELFYAML::BBAddrMapSection *>
106 Expected<ELFYAML::RawContentSection *>
109 bool shouldPrintSection(const ELFYAML::Section &S, const Elf_Shdr &SHdr,
114 Expected<ELFYAML::Object *> dump();
146 Ret = ELFYAML::appendUniqueSuffix(Name, Twine(++It.first->second)); in getUniquedSectionName()
178 ELFYAML::appendUniqueSuffix(Name, Twine(++It.first->second)); in getUniquedSymbolName()
188 bool ELFDumper<ELFT>::shouldPrintSection(const ELFYAML::Section &S, in shouldPrintSection()
207 if (const ELFYAML::RawContentSection *RawSec = in shouldPrintSection()
208 dyn_cast<const ELFYAML::RawContentSection>(&S)) { in shouldPrintSection()
213 ELFYAML::ELF_SHF ShFlags = RawSec->Flags.getValueOr(ELFYAML::ELF_SHF(0)); in shouldPrintSection()
216 return ShFlags != ELFYAML::ELF_SHF(ELF::SHF_MERGE | ELF::SHF_STRINGS); in shouldPrintSection()
231 return S.Flags.getValueOr(ELFYAML::ELF_SHF(0)) & ELF::SHF_ALLOC; in shouldPrintSection()
238 ArrayRef<ELFYAML::ProgramHeader> Phdrs, in dumpSectionOffsets()
239 std::vector<std::unique_ptr<ELFYAML::Chunk>> &V, in dumpSectionOffsets()
250 for (const std::unique_ptr<ELFYAML::Chunk> &C : in dumpSectionOffsets()
252 ELFYAML::Section &Sec = *cast<ELFYAML::Section>(C.get()); in dumpSectionOffsets()
265 !ELFYAML::shouldAllocateFileSpace(Phdrs, in dumpSectionOffsets()
266 *cast<ELFYAML::NoBitsSection>(&Sec))) in dumpSectionOffsets()
273 template <class ELFT> Expected<ELFYAML::Object *> ELFDumper<ELFT>::dump() { in dump()
274 auto Y = std::make_unique<ELFYAML::Object>(); in dump()
279 Y->Header.Class = ELFYAML::ELF_ELFCLASS(Obj.getHeader().getFileClass()); in dump()
280 Y->Header.Data = ELFYAML::ELF_ELFDATA(Obj.getHeader().getDataEncoding()); in dump()
285 Y->Header.Machine = ELFYAML::ELF_EM(Obj.getHeader().e_machine); in dump()
351 Expected<std::vector<std::unique_ptr<ELFYAML::Chunk>>> ChunksOrErr = in dump()
355 std::vector<std::unique_ptr<ELFYAML::Chunk>> Chunks = std::move(*ChunksOrErr); in dump()
357 std::vector<ELFYAML::Section *> OriginalOrder; in dump()
359 for (const std::unique_ptr<ELFYAML::Chunk> &C : in dump()
361 OriginalOrder.push_back(cast<ELFYAML::Section>(C.get())); in dump()
365 llvm::stable_sort(Chunks, [&](const std::unique_ptr<ELFYAML::Chunk> &A, in dump()
366 const std::unique_ptr<ELFYAML::Chunk> &B) { in dump()
367 return Sections[cast<ELFYAML::Section>(A.get())->OriginalSecNdx].sh_offset < in dump()
368 Sections[cast<ELFYAML::Section>(B.get())->OriginalSecNdx].sh_offset; in dump()
372 Expected<std::vector<ELFYAML::ProgramHeader>> PhdrsOrErr = in dump()
387 llvm::is_sorted(Chunks, [&](const std::unique_ptr<ELFYAML::Chunk> &A, in dump()
388 const std::unique_ptr<ELFYAML::Chunk> &B) { in dump()
389 return cast<ELFYAML::Section>(A.get())->OriginalSecNdx < in dump()
390 cast<ELFYAML::Section>(B.get())->OriginalSecNdx; in dump()
395 for (ELFYAML::Section *S : OriginalOrder) in dump()
399 llvm::erase_if(Chunks, [this, &Y](const std::unique_ptr<ELFYAML::Chunk> &C) { in dump()
400 const ELFYAML::Section &S = cast<ELFYAML::Section>(*C.get()); in dump()
409 static bool isInSegment(const ELFYAML::Section &Sec, in isInSegment()
443 Expected<std::vector<ELFYAML::ProgramHeader>>
445 ArrayRef<std::unique_ptr<ELFYAML::Chunk>> Chunks) { in dumpProgramHeaders()
446 std::vector<ELFYAML::ProgramHeader> Ret; in dumpProgramHeaders()
452 ELFYAML::ProgramHeader PH; in dumpProgramHeaders()
466 for (const std::unique_ptr<ELFYAML::Chunk> &C : Chunks) { in dumpProgramHeaders()
467 ELFYAML::Section &S = cast<ELFYAML::Section>(*C.get()); in dumpProgramHeaders()
484 std::vector<std::unique_ptr<ELFYAML::Chunk>> &Sections) { in dumpDWARFSections()
486 for (std::unique_ptr<ELFYAML::Chunk> &C : Sections) { in dumpDWARFSections()
490 if (ELFYAML::RawContentSection *RawSec = in dumpDWARFSections()
491 dyn_cast<ELFYAML::RawContentSection>(C.get())) { in dumpDWARFSections()
521 Expected<ELFYAML::RawContentSection *>
523 auto S = std::make_unique<ELFYAML::RawContentSection>(); in dumpPlaceholderSection()
530 Expected<std::vector<std::unique_ptr<ELFYAML::Chunk>>>
532 std::vector<std::unique_ptr<ELFYAML::Chunk>> Ret; in dumpSections()
533 auto Add = [&](Expected<ELFYAML::Chunk *> SecOrErr) -> Error { in dumpSections()
541 -> std::function<Expected<ELFYAML::Chunk *>(const Elf_Shdr *)> { in dumpSections()
603 if (std::function<Expected<ELFYAML::Chunk *>(const Elf_Shdr *)> DumpFn = in dumpSections()
616 if (ELFYAML::StackSizesSection::nameMatches(*NameOrErr)) { in dumpSections()
632 std::vector<ELFYAML::Symbol> &Symbols) { in dumpSymbols()
651 ELFYAML::Symbol S; in dumpSymbols()
662 StringRef StrTable, ELFYAML::Symbol &S) { in dumpSymbol()
676 S.Index = (ELFYAML::ELF_SHN)Sym->st_shndx; in dumpSymbol()
698 ELFYAML::Relocation &R) { in dumpRelocation()
730 static unsigned getDefaultShEntSize(ELFYAML::ELF_SHT SecType, in getDefaultShEntSize()
752 ELFYAML::Section &S) { in dumpCommonSection()
757 S.Flags = static_cast<ELFYAML::ELF_SHF>(Shdr->sh_flags); in dumpCommonSection()
791 const Elf_Shdr *Shdr, ELFYAML::RelocationSection &S) { in dumpCommonRelocationSection()
813 Expected<ELFYAML::StackSizesSection *>
815 auto S = std::make_unique<ELFYAML::StackSizesSection>(); in dumpStackSizesSection()
826 std::vector<ELFYAML::StackSizeEntry> Entries; in dumpStackSizesSection()
846 Expected<ELFYAML::BBAddrMapSection *>
848 auto S = std::make_unique<ELFYAML::BBAddrMapSection>(); in dumpBBAddrMapSection()
862 std::vector<ELFYAML::BBAddrMapEntry> Entries; in dumpBBAddrMapSection()
867 std::vector<ELFYAML::BBAddrMapEntry::BBEntry> BBEntries; in dumpBBAddrMapSection()
890 Expected<ELFYAML::AddrsigSection *>
892 auto S = std::make_unique<ELFYAML::AddrsigSection>(); in dumpAddrsigSection()
903 std::vector<ELFYAML::YAMLFlowString> Symbols; in dumpAddrsigSection()
931 Expected<ELFYAML::LinkerOptionsSection *>
933 auto S = std::make_unique<ELFYAML::LinkerOptionsSection>(); in dumpLinkerOptionsSection()
962 Expected<ELFYAML::DependentLibrariesSection *>
964 auto DL = std::make_unique<ELFYAML::DependentLibrariesSection>(); in dumpDependentLibrariesSection()
989 Expected<ELFYAML::CallGraphProfileSection *>
991 auto S = std::make_unique<ELFYAML::CallGraphProfileSection>(); in dumpCallGraphProfileSection()
1009 std::vector<ELFYAML::CallGraphEntry> Entries(Content.size() / 16); in dumpCallGraphProfileSection()
1012 auto ReadEntry = [&](ELFYAML::CallGraphEntry &E) { in dumpCallGraphProfileSection()
1033 for (ELFYAML::CallGraphEntry &E : Entries) { in dumpCallGraphProfileSection()
1045 Expected<ELFYAML::DynamicSection *>
1047 auto S = std::make_unique<ELFYAML::DynamicSection>(); in dumpDynamicSection()
1057 S->Entries->push_back({(ELFYAML::ELF_DYNTAG)Dyn.getTag(), Dyn.getVal()}); in dumpDynamicSection()
1063 Expected<ELFYAML::RelocationSection *>
1065 auto S = std::make_unique<ELFYAML::RelocationSection>(); in dumpRelocSection()
1081 ELFYAML::Relocation R; in dumpRelocSection()
1091 ELFYAML::Relocation R; in dumpRelocSection()
1103 Expected<ELFYAML::RelrSection *>
1105 auto S = std::make_unique<ELFYAML::RelrSection>(); in dumpRelrSection()
1127 Expected<ELFYAML::RawContentSection *>
1129 auto S = std::make_unique<ELFYAML::RawContentSection>(); in dumpContentSection()
1151 Expected<ELFYAML::SymtabShndxSection *>
1153 auto S = std::make_unique<ELFYAML::SymtabShndxSection>(); in dumpSymtabShndxSection()
1168 Expected<ELFYAML::NoBitsSection *>
1170 auto S = std::make_unique<ELFYAML::NoBitsSection>(); in dumpNoBitsSection()
1179 Expected<ELFYAML::NoteSection *>
1181 auto S = std::make_unique<ELFYAML::NoteSection>(); in dumpNoteSection()
1189 std::vector<ELFYAML::NoteEntry> Entries; in dumpNoteSection()
1215 Expected<ELFYAML::HashSection *>
1217 auto S = std::make_unique<ELFYAML::HashSection>(); in dumpHashSection()
1256 Expected<ELFYAML::GnuHashSection *>
1258 auto S = std::make_unique<ELFYAML::GnuHashSection>(); in dumpGnuHashSection()
1270 ELFYAML::GnuHashHeader Header; in dumpGnuHashSection()
1307 Expected<ELFYAML::VerdefSection *>
1312 auto S = std::make_unique<ELFYAML::VerdefSection>(); in dumpVerdefSection()
1336 ELFYAML::VerdefEntry Entry; in dumpVerdefSection()
1359 Expected<ELFYAML::SymverSection *>
1363 auto S = std::make_unique<ELFYAML::SymverSection>(); in dumpSymverSection()
1379 Expected<ELFYAML::VerneedSection *>
1384 auto S = std::make_unique<ELFYAML::VerneedSection>(); in dumpVerneedSection()
1409 ELFYAML::VerneedEntry Entry; in dumpVerneedSection()
1419 ELFYAML::VernauxEntry Aux; in dumpVerneedSection()
1456 Expected<ELFYAML::GroupSection *>
1458 auto S = std::make_unique<ELFYAML::GroupSection>(); in dumpGroupSection()
1491 Expected<ELFYAML::ARMIndexTableSection *>
1493 auto S = std::make_unique<ELFYAML::ARMIndexTableSection>(); in dumpARMIndexTableSection()
1518 Expected<ELFYAML::MipsABIFlags *>
1522 auto S = std::make_unique<ELFYAML::MipsABIFlags>(); in dumpMipsABIFlags()
1550 Expected<ELFYAML::Object *> YAMLOrErr = Dumper.dump(); in elf2yaml()
1554 std::unique_ptr<ELFYAML::Object> YAML(YAMLOrErr.get()); in elf2yaml()