Lines Matching refs:ELFYAML
195 ELFYAML::Object &Doc;
205 std::vector<Elf_Sym> toELFSymbols(ArrayRef<ELFYAML::Symbol> Symbols,
214 StringRef SecName, ELFYAML::Section *YAMLSec);
219 ELFYAML::Section *YAMLSec);
223 ELFYAML::Section *YAMLSec);
226 ELFYAML::Section *YAMLSec);
231 getPhdrFragments(const ELFYAML::ProgramHeader &Phdr,
237 const ELFYAML::NoBitsSection &Section,
240 const ELFYAML::RawContentSection &Section,
243 const ELFYAML::RelocationSection &Section,
246 const ELFYAML::RelrSection &Section,
249 const ELFYAML::GroupSection &Group,
252 const ELFYAML::SymtabShndxSection &Shndx,
255 const ELFYAML::SymverSection &Section,
258 const ELFYAML::VerneedSection &Section,
261 const ELFYAML::VerdefSection &Section,
264 const ELFYAML::ARMIndexTableSection &Section,
267 const ELFYAML::MipsABIFlags &Section,
270 const ELFYAML::DynamicSection &Section,
273 const ELFYAML::StackSizesSection &Section,
276 const ELFYAML::BBAddrMapSection &Section,
279 const ELFYAML::HashSection &Section,
282 const ELFYAML::AddrsigSection &Section,
285 const ELFYAML::NoteSection &Section,
288 const ELFYAML::GnuHashSection &Section,
291 const ELFYAML::LinkerOptionsSection &Section,
294 const ELFYAML::DependentLibrariesSection &Section,
297 const ELFYAML::CallGraphProfileSection &Section,
300 void writeFill(ELFYAML::Fill &Fill, ContiguousBlobAccumulator &CBA);
302 ELFState(ELFYAML::Object &D, yaml::ErrorHandler EH);
304 void assignSectionAddress(Elf_Shdr &SHeader, ELFYAML::Section *YAMLSec);
315 static bool writeELF(raw_ostream &OS, ELFYAML::Object &Doc,
331 ELFState<ELFT>::ELFState(ELFYAML::Object &D, yaml::ErrorHandler EH) in ELFState()
333 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in ELFState()
338 std::make_unique<ELFYAML::Section>( in ELFState()
339 ELFYAML::Chunk::ChunkKind::RawContent, /*IsImplicit=*/true)); in ELFState()
346 const std::unique_ptr<ELFYAML::Chunk> &C = Doc.Chunks[I]; in ELFState()
348 std::string NewName = ELFYAML::appendUniqueSuffix( in ELFState()
351 assert(ELFYAML::dropUniqueSuffix(C->Name).empty()); in ELFState()
379 std::unique_ptr<ELFYAML::Chunk> Sec = std::make_unique<ELFYAML::Section>( in ELFState()
380 ELFYAML::Chunk::ChunkKind::RawContent, true /*IsImplicit*/); in ELFState()
469 DenseMap<StringRef, ELFYAML::Fill *> NameToFill; in initProgramHeaders()
472 if (auto S = dyn_cast<ELFYAML::Fill>(Doc.Chunks[I].get())) in initProgramHeaders()
477 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in initProgramHeaders()
479 ELFYAML::ProgramHeader &YamlPhdr = Doc.ProgramHeaders[I]; in initProgramHeaders()
566 static void overrideFields(ELFYAML::Section *From, typename ELFT::Shdr &To) { in overrideFields()
586 ELFYAML::Section *YAMLSec) { in initImplicitHeader()
604 if (YAMLSec && !isa<ELFYAML::RawContentSection>(YAMLSec)) in initImplicitHeader()
620 std::string llvm::ELFYAML::appendUniqueSuffix(StringRef Name, in appendUniqueSuffix()
627 StringRef llvm::ELFYAML::dropUniqueSuffix(StringRef S) { in dropUniqueSuffix()
673 for (const std::unique_ptr<ELFYAML::Chunk> &D : Doc.Chunks) { in initSectionHeaders()
674 if (ELFYAML::Fill *S = dyn_cast<ELFYAML::Fill>(D.get())) { in initSectionHeaders()
681 ELFYAML::Section *Sec = cast<ELFYAML::Section>(D.get()); in initSectionHeaders()
699 getSectionNameOffset(ELFYAML::dropUniqueSuffix(Sec->Name)); in initSectionHeaders()
716 if (auto RawSec = dyn_cast<ELFYAML::RawContentSection>(Sec)) { in initSectionHeaders()
731 if (!isa<ELFYAML::NoBitsSection>(Sec) && (Sec->Content || Sec->Size)) in initSectionHeaders()
734 if (auto S = dyn_cast<ELFYAML::RawContentSection>(Sec)) { in initSectionHeaders()
736 } else if (auto S = dyn_cast<ELFYAML::SymtabShndxSection>(Sec)) { in initSectionHeaders()
738 } else if (auto S = dyn_cast<ELFYAML::RelocationSection>(Sec)) { in initSectionHeaders()
740 } else if (auto S = dyn_cast<ELFYAML::RelrSection>(Sec)) { in initSectionHeaders()
742 } else if (auto S = dyn_cast<ELFYAML::GroupSection>(Sec)) { in initSectionHeaders()
744 } else if (auto S = dyn_cast<ELFYAML::ARMIndexTableSection>(Sec)) { in initSectionHeaders()
746 } else if (auto S = dyn_cast<ELFYAML::MipsABIFlags>(Sec)) { in initSectionHeaders()
748 } else if (auto S = dyn_cast<ELFYAML::NoBitsSection>(Sec)) { in initSectionHeaders()
750 } else if (auto S = dyn_cast<ELFYAML::DynamicSection>(Sec)) { in initSectionHeaders()
752 } else if (auto S = dyn_cast<ELFYAML::SymverSection>(Sec)) { in initSectionHeaders()
754 } else if (auto S = dyn_cast<ELFYAML::VerneedSection>(Sec)) { in initSectionHeaders()
756 } else if (auto S = dyn_cast<ELFYAML::VerdefSection>(Sec)) { in initSectionHeaders()
758 } else if (auto S = dyn_cast<ELFYAML::StackSizesSection>(Sec)) { in initSectionHeaders()
760 } else if (auto S = dyn_cast<ELFYAML::HashSection>(Sec)) { in initSectionHeaders()
762 } else if (auto S = dyn_cast<ELFYAML::AddrsigSection>(Sec)) { in initSectionHeaders()
764 } else if (auto S = dyn_cast<ELFYAML::LinkerOptionsSection>(Sec)) { in initSectionHeaders()
766 } else if (auto S = dyn_cast<ELFYAML::NoteSection>(Sec)) { in initSectionHeaders()
768 } else if (auto S = dyn_cast<ELFYAML::GnuHashSection>(Sec)) { in initSectionHeaders()
770 } else if (auto S = dyn_cast<ELFYAML::DependentLibrariesSection>(Sec)) { in initSectionHeaders()
772 } else if (auto S = dyn_cast<ELFYAML::CallGraphProfileSection>(Sec)) { in initSectionHeaders()
774 } else if (auto S = dyn_cast<ELFYAML::BBAddrMapSection>(Sec)) { in initSectionHeaders()
789 ELFYAML::Section *YAMLSec) { in assignSectionAddress()
808 static size_t findFirstNonGlobal(ArrayRef<ELFYAML::Symbol> Symbols) { in findFirstNonGlobal()
817 ELFState<ELFT>::toELFSymbols(ArrayRef<ELFYAML::Symbol> Symbols, in toELFSymbols()
823 for (const ELFYAML::Symbol &Sym : Symbols) { in toELFSymbols()
832 Symbol.st_name = Strtab.getOffset(ELFYAML::dropUniqueSuffix(Sym.Name)); in toELFSymbols()
852 ELFYAML::Section *YAMLSec) { in initSymtabSectionHeader()
855 ArrayRef<ELFYAML::Symbol> Symbols; in initSymtabSectionHeader()
861 ELFYAML::RawContentSection *RawSec = in initSymtabSectionHeader()
862 dyn_cast_or_null<ELFYAML::RawContentSection>(YAMLSec); in initSymtabSectionHeader()
941 ELFYAML::Section *YAMLSec) { in initStrtabSectionHeader()
947 ELFYAML::RawContentSection *RawSec = in initStrtabSectionHeader()
948 dyn_cast_or_null<ELFYAML::RawContentSection>(YAMLSec); in initStrtabSectionHeader()
1003 ELFYAML::Section *YAMLSec) { in initDWARFSectionHeader()
1005 SHeader.sh_name = getSectionNameOffset(ELFYAML::dropUniqueSuffix(Name)); in initDWARFSectionHeader()
1011 ELFYAML::RawContentSection *RawSec = in initDWARFSectionHeader()
1012 dyn_cast_or_null<ELFYAML::RawContentSection>(YAMLSec); in initDWARFSectionHeader()
1063 ELFState<ELFT>::getPhdrFragments(const ELFYAML::ProgramHeader &Phdr, in getPhdrFragments()
1066 for (const ELFYAML::Chunk *C : Phdr.Chunks) { in getPhdrFragments()
1067 if (const ELFYAML::Fill *F = dyn_cast<ELFYAML::Fill>(C)) { in getPhdrFragments()
1073 const ELFYAML::Section *S = cast<ELFYAML::Section>(C); in getPhdrFragments()
1138 bool llvm::ELFYAML::shouldAllocateFileSpace( in shouldAllocateFileSpace()
1139 ArrayRef<ELFYAML::ProgramHeader> Phdrs, const ELFYAML::NoBitsSection &S) { in shouldAllocateFileSpace()
1140 for (const ELFYAML::ProgramHeader &PH : Phdrs) { in shouldAllocateFileSpace()
1142 PH.Chunks, [&](ELFYAML::Chunk *C) { return C->Name == S.Name; }); in shouldAllocateFileSpace()
1143 if (std::any_of(It, PH.Chunks.end(), [](ELFYAML::Chunk *C) { in shouldAllocateFileSpace()
1144 return (isa<ELFYAML::Fill>(C) || in shouldAllocateFileSpace()
1145 cast<ELFYAML::Section>(C)->Type != ELF::SHT_NOBITS); in shouldAllocateFileSpace()
1154 const ELFYAML::NoBitsSection &S, in writeSectionContent()
1170 Elf_Shdr &SHeader, const ELFYAML::RawContentSection &Section, in writeSectionContent()
1179 static bool isMips64EL(const ELFYAML::Object &Obj) { in isMips64EL()
1181 Obj.Header.Class == ELFYAML::ELF_ELFCLASS(ELF::ELFCLASS64) && in isMips64EL()
1182 Obj.Header.Data == ELFYAML::ELF_ELFDATA(ELF::ELFDATA2LSB); in isMips64EL()
1187 Elf_Shdr &SHeader, const ELFYAML::RelocationSection &Section, in writeSectionContent()
1211 for (const ELFYAML::Relocation &Rel : *Section.Relocations) { in writeSectionContent()
1237 const ELFYAML::RelrSection &Section, in writeSectionContent()
1257 Elf_Shdr &SHeader, const ELFYAML::SymtabShndxSection &Shndx, in writeSectionContent()
1276 const ELFYAML::GroupSection &Section, in writeSectionContent()
1295 for (const ELFYAML::SectionOrType &Member : *Section.Members) { in writeSectionContent()
1308 const ELFYAML::SymverSection &Section, in writeSectionContent()
1322 Elf_Shdr &SHeader, const ELFYAML::StackSizesSection &Section, in writeSectionContent()
1330 for (const ELFYAML::StackSizeEntry &E : *Section.Entries) { in writeSectionContent()
1338 Elf_Shdr &SHeader, const ELFYAML::BBAddrMapSection &Section, in writeSectionContent()
1343 for (const ELFYAML::BBAddrMapEntry &E : *Section.Entries) { in writeSectionContent()
1352 for (const ELFYAML::BBAddrMapEntry::BBEntry &BBE : *E.BBEntries) in writeSectionContent()
1361 Elf_Shdr &SHeader, const ELFYAML::LinkerOptionsSection &Section, in writeSectionContent()
1366 for (const ELFYAML::LinkerOption &LO : *Section.Options) { in writeSectionContent()
1377 Elf_Shdr &SHeader, const ELFYAML::DependentLibrariesSection &Section, in writeSectionContent()
1415 Elf_Shdr &SHeader, const ELFYAML::CallGraphProfileSection &Section, in writeSectionContent()
1430 for (const ELFYAML::CallGraphEntry &E : *Section.Entries) { in writeSectionContent()
1443 const ELFYAML::HashSection &Section, in writeSectionContent()
1478 const ELFYAML::VerdefSection &Section, in writeSectionContent()
1490 const ELFYAML::VerdefEntry &E = (*Section.Entries)[I]; in writeSectionContent()
1523 const ELFYAML::VerneedSection &Section, in writeSectionContent()
1535 const ELFYAML::VerneedEntry &VE = (*Section.VerneedV)[I]; in writeSectionContent()
1550 const ELFYAML::VernauxEntry &VAuxE = VE.AuxV[J]; in writeSectionContent()
1571 Elf_Shdr &SHeader, const ELFYAML::ARMIndexTableSection &Section, in writeSectionContent()
1576 for (const ELFYAML::ARMIndexTableEntry &E : *Section.Entries) { in writeSectionContent()
1585 const ELFYAML::MipsABIFlags &Section, in writeSectionContent()
1611 const ELFYAML::DynamicSection &Section, in writeSectionContent()
1624 for (const ELFYAML::DynamicEntry &DE : *Section.Entries) { in writeSectionContent()
1633 const ELFYAML::AddrsigSection &Section, in writeSectionContent()
1653 const ELFYAML::NoteSection &Section, in writeSectionContent()
1659 for (const ELFYAML::NoteEntry &NE : *Section.Notes) { in writeSectionContent()
1694 const ELFYAML::GnuHashSection &Section, in writeSectionContent()
1749 void ELFState<ELFT>::writeFill(ELFYAML::Fill &Fill, in writeFill()
1773 auto AddSection = [&](const ELFYAML::SectionHeader &Hdr) { in buildSectionHeaderReorderMap()
1781 for (const ELFYAML::SectionHeader &Hdr : *Doc.SectionHeaders->Sections) in buildSectionHeaderReorderMap()
1785 for (const ELFYAML::SectionHeader &Hdr : *Doc.SectionHeaders->Excluded) in buildSectionHeaderReorderMap()
1788 for (const ELFYAML::Section *S : Doc.getSections()) { in buildSectionHeaderReorderMap()
1813 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in buildSectionIndex()
1816 for (const ELFYAML::SectionHeader &Hdr : *Doc.SectionHeaders->Excluded) in buildSectionIndex()
1821 for (const ELFYAML::Section *S : Sections) in buildSectionIndex()
1827 for (const ELFYAML::Section *S : Sections) { in buildSectionIndex()
1835 DotShStrtab.add(ELFYAML::dropUniqueSuffix(S->Name)); in buildSectionIndex()
1842 auto Build = [this](ArrayRef<ELFYAML::Symbol> V, NameToIdxMap &Map) { in buildSymbolIndexes()
1844 const ELFYAML::Symbol &Sym = V[I]; in buildSymbolIndexes()
1859 for (const ELFYAML::Symbol &Sym : *Doc.Symbols) in finalizeStrings()
1860 DotStrtab.add(ELFYAML::dropUniqueSuffix(Sym.Name)); in finalizeStrings()
1865 for (const ELFYAML::Symbol &Sym : *Doc.DynamicSymbols) in finalizeStrings()
1866 DotDynstr.add(ELFYAML::dropUniqueSuffix(Sym.Name)); in finalizeStrings()
1870 for (const ELFYAML::Chunk *Sec : Doc.getSections()) { in finalizeStrings()
1871 if (auto VerNeed = dyn_cast<ELFYAML::VerneedSection>(Sec)) { in finalizeStrings()
1873 for (const ELFYAML::VerneedEntry &VE : *VerNeed->VerneedV) { in finalizeStrings()
1875 for (const ELFYAML::VernauxEntry &Aux : VE.AuxV) in finalizeStrings()
1879 } else if (auto VerDef = dyn_cast<ELFYAML::VerdefSection>(Sec)) { in finalizeStrings()
1881 for (const ELFYAML::VerdefEntry &E : *VerDef->Entries) in finalizeStrings()
1891 bool ELFState<ELFT>::writeELF(raw_ostream &OS, ELFYAML::Object &Doc, in writeELF()
1963 bool yaml2elf(llvm::ELFYAML::Object &Doc, raw_ostream &Out, ErrorHandler EH, in yaml2elf()
1965 bool IsLE = Doc.Header.Data == ELFYAML::ELF_ELFDATA(ELF::ELFDATA2LSB); in yaml2elf()
1966 bool Is64Bit = Doc.Header.Class == ELFYAML::ELF_ELFCLASS(ELF::ELFCLASS64); in yaml2elf()