Lines Matching refs:Section
223 StringRef SecName, ELFYAML::Section *YAMLSec);
228 ELFYAML::Section *YAMLSec);
232 ELFYAML::Section *YAMLSec);
235 ELFYAML::Section *YAMLSec);
246 const ELFYAML::NoBitsSection &Section,
249 const ELFYAML::RawContentSection &Section,
252 const ELFYAML::RelocationSection &Section,
255 const ELFYAML::RelrSection &Section,
264 const ELFYAML::SymverSection &Section,
267 const ELFYAML::VerneedSection &Section,
270 const ELFYAML::VerdefSection &Section,
273 const ELFYAML::ARMIndexTableSection &Section,
276 const ELFYAML::MipsABIFlags &Section,
279 const ELFYAML::DynamicSection &Section,
282 const ELFYAML::StackSizesSection &Section,
285 const ELFYAML::BBAddrMapSection &Section,
288 const ELFYAML::HashSection &Section,
291 const ELFYAML::AddrsigSection &Section,
294 const ELFYAML::NoteSection &Section,
297 const ELFYAML::GnuHashSection &Section,
300 const ELFYAML::LinkerOptionsSection &Section,
303 const ELFYAML::DependentLibrariesSection &Section,
306 const ELFYAML::CallGraphProfileSection &Section,
313 void assignSectionAddress(Elf_Shdr &SHeader, ELFYAML::Section *YAMLSec);
354 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in ELFState()
359 std::make_unique<ELFYAML::Section>( in ELFState()
426 std::unique_ptr<ELFYAML::Section> Sec = std::make_unique<ELFYAML::Section>( in ELFState()
544 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in initProgramHeaders()
635 static void overrideFields(ELFYAML::Section *From, typename ELFT::Shdr &To) { in overrideFields()
655 ELFYAML::Section *YAMLSec) { in initImplicitHeader()
792 ELFYAML::Section *Sec = cast<ELFYAML::Section>(D.get()); in initSectionHeaders()
911 ELFYAML::Section *YAMLSec) { in assignSectionAddress()
957 if (Sym.Section) in toELFSymbols()
958 Symbol.st_shndx = toSectionIndex(*Sym.Section, "", Sym.Name); in toELFSymbols()
974 ELFYAML::Section *YAMLSec) { in initSymtabSectionHeader()
1039 ELFYAML::Section *YAMLSec) { in initStrtabSectionHeader()
1097 ELFYAML::Section *YAMLSec) { in initDWARFSectionHeader()
1158 const ELFYAML::Section *S = cast<ELFYAML::Section>(C); in getPhdrFragments()
1230 cast<ELFYAML::Section>(C)->Type != ELF::SHT_NOBITS); in shouldAllocateFileSpace()
1255 Elf_Shdr &SHeader, const ELFYAML::RawContentSection &Section, in writeSectionContent() argument
1257 if (Section.Info) in writeSectionContent()
1258 SHeader.sh_info = *Section.Info; in writeSectionContent()
1269 Elf_Shdr &SHeader, const ELFYAML::RelocationSection &Section, in writeSectionContent() argument
1271 assert((Section.Type == llvm::ELF::SHT_REL || in writeSectionContent()
1272 Section.Type == llvm::ELF::SHT_RELA) && in writeSectionContent()
1275 if (!Section.RelocatableSec.empty()) in writeSectionContent()
1276 SHeader.sh_info = toSectionIndex(Section.RelocatableSec, Section.Name); in writeSectionContent()
1278 if (!Section.Relocations) in writeSectionContent()
1281 const bool IsRela = Section.Type == llvm::ELF::SHT_RELA; in writeSectionContent()
1282 for (const ELFYAML::Relocation &Rel : *Section.Relocations) { in writeSectionContent()
1283 const bool IsDynamic = Section.Link && (*Section.Link == ".dynsym"); in writeSectionContent()
1285 Rel.Symbol ? toSymbolIndex(*Rel.Symbol, Section.Name, IsDynamic) : 0; in writeSectionContent()
1303 Section.Relocations->size(); in writeSectionContent()
1308 const ELFYAML::RelrSection &Section, in writeSectionContent() argument
1310 if (!Section.Entries) in writeSectionContent()
1313 for (llvm::yaml::Hex64 E : *Section.Entries) { in writeSectionContent()
1315 reportError(Section.Name + ": the value is too large for 32-bits: 0x" + in writeSectionContent()
1320 SHeader.sh_size = sizeof(uintX_t) * Section.Entries->size(); in writeSectionContent()
1342 const ELFYAML::GroupSection &Section, in writeSectionContent() argument
1344 assert(Section.Type == llvm::ELF::SHT_GROUP && in writeSectionContent()
1347 if (Section.Signature) in writeSectionContent()
1349 toSymbolIndex(*Section.Signature, Section.Name, /*IsDynamic=*/false); in writeSectionContent()
1351 if (!Section.Members) in writeSectionContent()
1354 for (const ELFYAML::SectionOrType &Member : *Section.Members) { in writeSectionContent()
1359 SectionIndex = toSectionIndex(Member.sectionNameOrType, Section.Name); in writeSectionContent()
1362 SHeader.sh_size = SHeader.sh_entsize * Section.Members->size(); in writeSectionContent()
1367 const ELFYAML::SymverSection &Section, in writeSectionContent() argument
1369 if (!Section.Entries) in writeSectionContent()
1372 for (uint16_t Version : *Section.Entries) in writeSectionContent()
1374 SHeader.sh_size = Section.Entries->size() * SHeader.sh_entsize; in writeSectionContent()
1379 Elf_Shdr &SHeader, const ELFYAML::StackSizesSection &Section, in writeSectionContent() argument
1381 if (!Section.Entries) in writeSectionContent()
1384 for (const ELFYAML::StackSizeEntry &E : *Section.Entries) { in writeSectionContent()
1392 Elf_Shdr &SHeader, const ELFYAML::BBAddrMapSection &Section, in writeSectionContent() argument
1394 if (!Section.Entries) { in writeSectionContent()
1395 if (Section.PGOAnalyses) in writeSectionContent()
1403 if (Section.PGOAnalyses) { in writeSectionContent()
1404 if (Section.Entries->size() != Section.PGOAnalyses->size()) in writeSectionContent()
1408 PGOAnalyses = &Section.PGOAnalyses.value(); in writeSectionContent()
1411 for (const auto &[Idx, E] : llvm::enumerate(*Section.Entries)) { in writeSectionContent()
1413 if (Section.Type == llvm::ELF::SHT_LLVM_BB_ADDR_MAP) { in writeSectionContent()
1423 if (Section.PGOAnalyses) { in writeSectionContent()
1440 if (Section.Type == llvm::ELF::SHT_LLVM_BB_ADDR_MAP && E.Version > 1) in writeSectionContent()
1481 Elf_Shdr &SHeader, const ELFYAML::LinkerOptionsSection &Section, in writeSectionContent() argument
1483 if (!Section.Options) in writeSectionContent()
1486 for (const ELFYAML::LinkerOption &LO : *Section.Options) { in writeSectionContent()
1497 Elf_Shdr &SHeader, const ELFYAML::DependentLibrariesSection &Section, in writeSectionContent() argument
1499 if (!Section.Libs) in writeSectionContent()
1502 for (StringRef Lib : *Section.Libs) { in writeSectionContent()
1535 Elf_Shdr &SHeader, const ELFYAML::CallGraphProfileSection &Section, in writeSectionContent() argument
1537 if (!Section.Entries) in writeSectionContent()
1540 for (const ELFYAML::CallGraphEntryWeight &E : *Section.Entries) { in writeSectionContent()
1548 const ELFYAML::HashSection &Section, in writeSectionContent() argument
1550 if (!Section.Bucket) in writeSectionContent()
1554 Section.NBucket.value_or(llvm::yaml::Hex64(Section.Bucket->size())), in writeSectionContent()
1557 Section.NChain.value_or(llvm::yaml::Hex64(Section.Chain->size())), in writeSectionContent()
1560 for (uint32_t Val : *Section.Bucket) in writeSectionContent()
1562 for (uint32_t Val : *Section.Chain) in writeSectionContent()
1565 SHeader.sh_size = (2 + Section.Bucket->size() + Section.Chain->size()) * 4; in writeSectionContent()
1570 const ELFYAML::VerdefSection &Section, in writeSectionContent() argument
1573 if (Section.Info) in writeSectionContent()
1574 SHeader.sh_info = *Section.Info; in writeSectionContent()
1575 else if (Section.Entries) in writeSectionContent()
1576 SHeader.sh_info = Section.Entries->size(); in writeSectionContent()
1578 if (!Section.Entries) in writeSectionContent()
1582 for (size_t I = 0; I < Section.Entries->size(); ++I) { in writeSectionContent()
1583 const ELFYAML::VerdefEntry &E = (*Section.Entries)[I]; in writeSectionContent()
1592 if (I == Section.Entries->size() - 1) in writeSectionContent()
1610 SHeader.sh_size = Section.Entries->size() * sizeof(Elf_Verdef) + in writeSectionContent()
1616 const ELFYAML::VerneedSection &Section, in writeSectionContent() argument
1618 if (Section.Info) in writeSectionContent()
1619 SHeader.sh_info = *Section.Info; in writeSectionContent()
1620 else if (Section.VerneedV) in writeSectionContent()
1621 SHeader.sh_info = Section.VerneedV->size(); in writeSectionContent()
1623 if (!Section.VerneedV) in writeSectionContent()
1627 for (size_t I = 0; I < Section.VerneedV->size(); ++I) { in writeSectionContent()
1628 const ELFYAML::VerneedEntry &VE = (*Section.VerneedV)[I]; in writeSectionContent()
1633 if (I == Section.VerneedV->size() - 1) in writeSectionContent()
1658 SHeader.sh_size = Section.VerneedV->size() * sizeof(Elf_Verneed) + in writeSectionContent()
1664 Elf_Shdr &SHeader, const ELFYAML::ARMIndexTableSection &Section, in writeSectionContent() argument
1666 if (!Section.Entries) in writeSectionContent()
1669 for (const ELFYAML::ARMIndexTableEntry &E : *Section.Entries) { in writeSectionContent()
1673 SHeader.sh_size = Section.Entries->size() * 8; in writeSectionContent()
1678 const ELFYAML::MipsABIFlags &Section, in writeSectionContent() argument
1680 assert(Section.Type == llvm::ELF::SHT_MIPS_ABIFLAGS && in writeSectionContent()
1687 Flags.version = Section.Version; in writeSectionContent()
1688 Flags.isa_level = Section.ISALevel; in writeSectionContent()
1689 Flags.isa_rev = Section.ISARevision; in writeSectionContent()
1690 Flags.gpr_size = Section.GPRSize; in writeSectionContent()
1691 Flags.cpr1_size = Section.CPR1Size; in writeSectionContent()
1692 Flags.cpr2_size = Section.CPR2Size; in writeSectionContent()
1693 Flags.fp_abi = Section.FpABI; in writeSectionContent()
1694 Flags.isa_ext = Section.ISAExtension; in writeSectionContent()
1695 Flags.ases = Section.ASEs; in writeSectionContent()
1696 Flags.flags1 = Section.Flags1; in writeSectionContent()
1697 Flags.flags2 = Section.Flags2; in writeSectionContent()
1703 const ELFYAML::DynamicSection &Section, in writeSectionContent() argument
1705 assert(Section.Type == llvm::ELF::SHT_DYNAMIC && in writeSectionContent()
1708 if (!Section.Entries) in writeSectionContent()
1711 for (const ELFYAML::DynamicEntry &DE : *Section.Entries) { in writeSectionContent()
1715 SHeader.sh_size = 2 * sizeof(uintX_t) * Section.Entries->size(); in writeSectionContent()
1720 const ELFYAML::AddrsigSection &Section, in writeSectionContent() argument
1722 if (!Section.Symbols) in writeSectionContent()
1725 for (StringRef Sym : *Section.Symbols) in writeSectionContent()
1727 CBA.writeULEB128(toSymbolIndex(Sym, Section.Name, /*IsDynamic=*/false)); in writeSectionContent()
1732 const ELFYAML::NoteSection &Section, in writeSectionContent() argument
1734 if (!Section.Notes) in writeSectionContent()
1738 for (const ELFYAML::NoteEntry &NE : *Section.Notes) { in writeSectionContent()
1773 const ELFYAML::GnuHashSection &Section, in writeSectionContent() argument
1775 if (!Section.HashBuckets) in writeSectionContent()
1778 if (!Section.Header) in writeSectionContent()
1785 if (Section.Header->NBuckets) in writeSectionContent()
1786 CBA.write<uint32_t>(*Section.Header->NBuckets, ELFT::TargetEndianness); in writeSectionContent()
1788 CBA.write<uint32_t>(Section.HashBuckets->size(), ELFT::TargetEndianness); in writeSectionContent()
1792 CBA.write<uint32_t>(Section.Header->SymNdx, ELFT::TargetEndianness); in writeSectionContent()
1796 if (Section.Header->MaskWords) in writeSectionContent()
1797 CBA.write<uint32_t>(*Section.Header->MaskWords, ELFT::TargetEndianness); in writeSectionContent()
1799 CBA.write<uint32_t>(Section.BloomFilter->size(), ELFT::TargetEndianness); in writeSectionContent()
1802 CBA.write<uint32_t>(Section.Header->Shift2, ELFT::TargetEndianness); in writeSectionContent()
1805 for (llvm::yaml::Hex64 Val : *Section.BloomFilter) in writeSectionContent()
1809 for (llvm::yaml::Hex32 Val : *Section.HashBuckets) in writeSectionContent()
1813 for (llvm::yaml::Hex32 Val : *Section.HashValues) in writeSectionContent()
1817 Section.BloomFilter->size() * sizeof(typename ELFT::uint) + in writeSectionContent()
1818 Section.HashBuckets->size() * 4 + in writeSectionContent()
1819 Section.HashValues->size() * 4; in writeSectionContent()
1865 for (const ELFYAML::Section *S : Doc.getSections()) { in buildSectionHeaderReorderMap()
1890 std::vector<ELFYAML::Section *> Sections = Doc.getSections(); in buildSectionIndex()
1899 for (const ELFYAML::Section *S : Sections) in buildSectionIndex()
1904 for (const ELFYAML::Section *S : Sections) { in buildSectionIndex()