Lines Matching refs:Sec

69 template <class ELFT> void ELFWriter<ELFT>::writeShdr(const SectionBase &Sec) {  in writeShdr()  argument
71 reinterpret_cast<uint8_t *>(Buf->getBufferStart()) + Sec.HeaderOffset; in writeShdr()
73 Shdr.sh_name = Sec.NameIndex; in writeShdr()
74 Shdr.sh_type = Sec.Type; in writeShdr()
75 Shdr.sh_flags = Sec.Flags; in writeShdr()
76 Shdr.sh_addr = Sec.Addr; in writeShdr()
77 Shdr.sh_offset = Sec.Offset; in writeShdr()
78 Shdr.sh_size = Sec.Size; in writeShdr()
79 Shdr.sh_link = Sec.Link; in writeShdr()
80 Shdr.sh_info = Sec.Info; in writeShdr()
81 Shdr.sh_addralign = Sec.Align; in writeShdr()
82 Shdr.sh_entsize = Sec.EntrySize; in writeShdr()
103 Error ELFSectionSizer<ELFT>::visit(SymbolTableSection &Sec) { in visit() argument
104 Sec.EntrySize = sizeof(Elf_Sym); in visit()
105 Sec.Size = Sec.Symbols.size() * Sec.EntrySize; in visit()
107 Sec.Align = ELFT::Is64Bits ? sizeof(Elf_Xword) : sizeof(Elf_Word); in visit()
125 Error ELFSectionSizer<ELFT>::visit(RelocationSection &Sec) { in visit() argument
126 if (Sec.Type == SHT_CREL) { in visit()
127 Sec.Size = encodeCrel<ELFT::Is64Bits>(Sec.Relocations).size(); in visit()
129 Sec.EntrySize = Sec.Type == SHT_REL ? sizeof(Elf_Rel) : sizeof(Elf_Rela); in visit()
130 Sec.Size = Sec.Relocations.size() * Sec.EntrySize; in visit()
132 Sec.Align = ELFT::Is64Bits ? sizeof(Elf_Xword) : sizeof(Elf_Word); in visit()
142 template <class ELFT> Error ELFSectionSizer<ELFT>::visit(GroupSection &Sec) { in visit() argument
143 Sec.Size = sizeof(Elf_Word) + Sec.GroupMembers.size() * sizeof(Elf_Word); in visit()
161 Error BinarySectionWriter::visit(const SectionIndexSection &Sec) { in visit() argument
164 Sec.Name + "' "); in visit()
167 Error BinarySectionWriter::visit(const SymbolTableSection &Sec) { in visit() argument
169 "cannot write symbol table '" + Sec.Name + in visit()
173 Error BinarySectionWriter::visit(const RelocationSection &Sec) { in visit() argument
175 "cannot write relocation section '" + Sec.Name + in visit()
179 Error BinarySectionWriter::visit(const GnuDebugLinkSection &Sec) { in visit() argument
181 "cannot write '" + Sec.Name + "' out to binary"); in visit()
184 Error BinarySectionWriter::visit(const GroupSection &Sec) { in visit() argument
186 "cannot write '" + Sec.Name + "' out to binary"); in visit()
189 Error SectionWriter::visit(const Section &Sec) { in visit() argument
190 if (Sec.Type != SHT_NOBITS) in visit()
191 llvm::copy(Sec.Contents, Out.getBufferStart() + Sec.Offset); in visit()
346 static uint64_t sectionPhysicalAddr(const SectionBase *Sec) { in sectionPhysicalAddr() argument
347 Segment *Seg = Sec->ParentSegment; in sectionPhysicalAddr()
350 return Seg ? Seg->PAddr + Sec->OriginalOffset - Seg->OriginalOffset in sectionPhysicalAddr()
351 : Sec->Addr; in sectionPhysicalAddr()
354 void IHexSectionWriterBase::writeSection(const SectionBase *Sec, in writeSection() argument
356 assert(Data.size() == Sec->Size); in writeSection()
358 uint32_t Addr = sectionPhysicalAddr(Sec) & 0xFFFFFFFFU; in writeSection()
403 Error IHexSectionWriterBase::visit(const Section &Sec) { in visit() argument
404 writeSection(&Sec, Sec.Contents); in visit()
408 Error IHexSectionWriterBase::visit(const OwnedDataSection &Sec) { in visit() argument
409 writeSection(&Sec, Sec.Data); in visit()
413 Error IHexSectionWriterBase::visit(const StringTableSection &Sec) { in visit() argument
415 assert(Sec.Size == Sec.StrTabBuilder.getSize()); in visit()
419 writeSection(&Sec, {nullptr, static_cast<size_t>(Sec.Size)}); in visit()
423 Error IHexSectionWriterBase::visit(const DynamicRelocationSection &Sec) { in visit() argument
424 writeSection(&Sec, Sec.Contents); in visit()
435 Error IHexSectionWriter::visit(const StringTableSection &Sec) { in visit() argument
436 assert(Sec.Size == Sec.StrTabBuilder.getSize()); in visit()
437 std::vector<uint8_t> Data(Sec.Size); in visit()
438 Sec.StrTabBuilder.write(Data.data()); in visit()
439 writeSection(&Sec, Data); in visit()
458 Error SectionWriter::visit(const OwnedDataSection &Sec) { in visit() argument
459 llvm::copy(Sec.Data, Out.getBufferStart() + Sec.Offset); in visit()
464 Error ELFSectionWriter<ELFT>::visit(const DecompressedSection &Sec) { in visit() argument
466 Sec.OriginalData.slice(sizeof(Elf_Chdr_Impl<ELFT>)); in visit()
469 switch (Sec.ChType) { in visit()
479 Twine(Sec.ChType) + ") of section '" + in visit()
480 Sec.Name + "' is unsupported"); in visit()
485 "failed to decompress section '" + Sec.Name + in visit()
488 static_cast<size_t>(Sec.Size))) in visit()
490 "failed to decompress section '" + Sec.Name + in visit()
493 uint8_t *Buf = reinterpret_cast<uint8_t *>(Out.getBufferStart()) + Sec.Offset; in visit()
499 Error BinarySectionWriter::visit(const DecompressedSection &Sec) { in visit() argument
501 "cannot write compressed section '" + Sec.Name + in visit()
530 Error BinarySectionWriter::visit(const CompressedSection &Sec) { in visit() argument
532 "cannot write compressed section '" + Sec.Name + in visit()
537 Error ELFSectionWriter<ELFT>::visit(const CompressedSection &Sec) { in visit() argument
538 uint8_t *Buf = reinterpret_cast<uint8_t *>(Out.getBufferStart()) + Sec.Offset; in visit()
540 switch (Sec.CompressionType) { in visit()
542 std::copy(Sec.OriginalData.begin(), Sec.OriginalData.end(), Buf); in visit()
551 Chdr.ch_size = Sec.DecompressedSize; in visit()
552 Chdr.ch_addralign = Sec.DecompressedAlign; in visit()
556 std::copy(Sec.CompressedData.begin(), Sec.CompressedData.end(), Buf); in visit()
560 CompressedSection::CompressedSection(const SectionBase &Sec, in CompressedSection() argument
563 : SectionBase(Sec), CompressionType(CompressionType), in CompressedSection()
564 DecompressedSize(Sec.OriginalData.size()), DecompressedAlign(Sec.Align) { in CompressedSection()
603 Error SectionWriter::visit(const StringTableSection &Sec) { in visit() argument
604 Sec.StrTabBuilder.write(reinterpret_cast<uint8_t *>(Out.getBufferStart()) + in visit()
605 Sec.Offset); in visit()
618 Error ELFSectionWriter<ELFT>::visit(const SectionIndexSection &Sec) { in visit() argument
619 uint8_t *Buf = reinterpret_cast<uint8_t *>(Out.getBufferStart()) + Sec.Offset; in visit()
620 llvm::copy(Sec.Indexes, reinterpret_cast<Elf_Word *>(Buf)); in visit()
626 Expected<SymbolTableSection *> Sec = in initialize() local
633 if (!Sec) in initialize()
634 return Sec.takeError(); in initialize()
636 setSymTab(*Sec); in initialize()
791 Expected<StringTableSection *> Sec = in initialize() local
798 if (!Sec) in initialize()
799 return Sec.takeError(); in initialize()
801 setStrTab(*Sec); in initialize()
865 Error ELFSectionWriter<ELFT>::visit(const SymbolTableSection &Sec) { in visit() argument
866 Elf_Sym *Sym = reinterpret_cast<Elf_Sym *>(Out.getBufferStart() + Sec.Offset); in visit()
868 for (const std::unique_ptr<Symbol> &Symbol : Sec.Symbols) { in visit()
933 Expected<SymTabType *> Sec = SecTable.getSectionOfType<SymTabType>( in initialize() local
939 if (!Sec) in initialize()
940 return Sec.takeError(); in initialize()
942 setSymTab(*Sec); in initialize()
946 Expected<SectionBase *> Sec = in initialize() local
949 if (!Sec) in initialize()
950 return Sec.takeError(); in initialize()
952 setSection(*Sec); in initialize()
987 Error ELFSectionWriter<ELFT>::visit(const RelocationSection &Sec) { in visit() argument
988 uint8_t *Buf = reinterpret_cast<uint8_t *>(Out.getBufferStart()) + Sec.Offset; in visit()
989 if (Sec.Type == SHT_CREL) { in visit()
990 auto Content = encodeCrel<ELFT::Is64Bits>(Sec.Relocations); in visit()
992 } else if (Sec.Type == SHT_REL) { in visit()
993 writeRel(Sec.Relocations, reinterpret_cast<Elf_Rel *>(Buf), in visit()
994 Sec.getObject().IsMips64EL); in visit()
996 writeRel(Sec.Relocations, reinterpret_cast<Elf_Rela *>(Buf), in visit()
997 Sec.getObject().IsMips64EL); in visit()
1034 Error SectionWriter::visit(const DynamicRelocationSection &Sec) { in visit() argument
1035 llvm::copy(Sec.Contents, Out.getBufferStart() + Sec.Offset); in visit()
1124 for (SectionBase *&Sec : GroupMembers) in replaceSectionReferences()
1125 if (SectionBase *To = FromTo.lookup(Sec)) in replaceSectionReferences()
1126 Sec = To; in replaceSectionReferences()
1132 for (SectionBase *Sec : GroupMembers) in onRemove()
1133 Sec->Flags &= ~SHF_GROUP; in onRemove()
1140 Expected<SectionBase *> Sec = in initialize() local
1143 if (!Sec) in initialize()
1144 return Sec.takeError(); in initialize()
1146 LinkSection = *Sec; in initialize()
1182 Error ELFSectionWriter<ELFT>::visit(const GnuDebugLinkSection &Sec) { in visit() argument
1184 reinterpret_cast<uint8_t *>(Out.getBufferStart()) + Sec.Offset; in visit()
1186 reinterpret_cast<Elf_Word *>(Buf + Sec.Size - sizeof(Elf_Word)); in visit()
1187 *CRC = Sec.CRC32; in visit()
1188 llvm::copy(Sec.FileName, Buf); in visit()
1201 Error ELFSectionWriter<ELFT>::visit(const GroupSection &Sec) { in visit() argument
1203 reinterpret_cast<ELF::Elf32_Word *>(Out.getBufferStart() + Sec.Offset); in visit()
1204 endian::write32<ELFT::Endianness>(Buf++, Sec.FlagWord); in visit()
1205 for (SectionBase *S : Sec.GroupMembers) in visit()
1219 static bool sectionWithinSegment(const SectionBase &Sec, const Segment &Seg) { in sectionWithinSegment() argument
1224 uint64_t SecSize = Sec.Size ? Sec.Size : 1; in sectionWithinSegment()
1227 if (Sec.OriginalOffset == std::numeric_limits<uint64_t>::max()) in sectionWithinSegment()
1230 if (Sec.Type == SHT_NOBITS) { in sectionWithinSegment()
1231 if (!(Sec.Flags & SHF_ALLOC)) in sectionWithinSegment()
1234 bool SectionIsTLS = Sec.Flags & SHF_TLS; in sectionWithinSegment()
1239 return Seg.VAddr <= Sec.Addr && in sectionWithinSegment()
1240 Seg.VAddr + Seg.MemSize >= Sec.Addr + SecSize; in sectionWithinSegment()
1243 return Seg.Offset <= Sec.OriginalOffset && in sectionWithinSegment()
1244 Seg.Offset + Seg.FileSize >= Sec.OriginalOffset + SecSize; in sectionWithinSegment()
1306 for (SectionBase &Sec : Obj->sections()) in initSections()
1307 if (Error Err = Sec.initialize(Obj->sections())) in initSections()
1438 for (const SectionBase &Sec : Obj.sections()) { in findEhdrOffset() local
1439 if (Sec.Type == SHT_LLVM_PART_EHDR && Sec.Name == *ExtractPartition) { in findEhdrOffset()
1440 EhdrOffset = Sec.Offset; in findEhdrOffset()
1479 for (SectionBase &Sec : Obj.sections()) in readProgramHeaders()
1480 if (sectionWithinSegment(Sec, Seg)) { in readProgramHeaders()
1481 Seg.addSection(&Sec); in readProgramHeaders()
1482 if (!Sec.ParentSegment || Sec.ParentSegment->Offset > Seg.Offset) in readProgramHeaders()
1483 Sec.ParentSegment = &Seg; in readProgramHeaders()
1554 Expected<SectionBase *> Sec = SecTable.getSection( in initGroupSection() local
1557 if (!Sec) in initGroupSection()
1558 return Sec.takeError(); in initGroupSection()
1560 GroupSec->addMember(*Sec); in initGroupSection()
1615 Expected<SectionBase *> Sec = Obj.sections().getSection( in initSymbolTable() local
1618 if (!Sec) in initSymbolTable()
1619 return Sec.takeError(); in initSymbolTable()
1621 DefSection = *Sec; in initSymbolTable()
1632 Expected<SectionBase *> Sec = Obj.sections().getSection( in initSymbolTable() local
1636 if (!Sec) in initSymbolTable()
1637 return Sec.takeError(); in initSymbolTable()
1639 DefSection = *Sec; in initSymbolTable()
1700 if (T *Sec = dyn_cast<T>(*BaseSec)) in getSectionOfType() local
1701 return Sec; in getSectionOfType()
1799 Expected<SectionBase &> Sec = makeSection(Shdr); in readSectionHeaders() local
1800 if (!Sec) in readSectionHeaders()
1801 return Sec.takeError(); in readSectionHeaders()
1806 Sec->Name = SecName->str(); in readSectionHeaders()
1807 Sec->Type = Sec->OriginalType = Shdr.sh_type; in readSectionHeaders()
1808 Sec->Flags = Sec->OriginalFlags = Shdr.sh_flags; in readSectionHeaders()
1809 Sec->Addr = Shdr.sh_addr; in readSectionHeaders()
1810 Sec->Offset = Shdr.sh_offset; in readSectionHeaders()
1811 Sec->OriginalOffset = Shdr.sh_offset; in readSectionHeaders()
1812 Sec->Size = Shdr.sh_size; in readSectionHeaders()
1813 Sec->Link = Shdr.sh_link; in readSectionHeaders()
1814 Sec->Info = Shdr.sh_info; in readSectionHeaders()
1815 Sec->Align = Shdr.sh_addralign; in readSectionHeaders()
1816 Sec->EntrySize = Shdr.sh_entsize; in readSectionHeaders()
1817 Sec->Index = Index++; in readSectionHeaders()
1818 Sec->OriginalIndex = Sec->Index; in readSectionHeaders()
1819 Sec->OriginalData = ArrayRef<uint8_t>( in readSectionHeaders()
1830 Expected<const Elf_Shdr *> Sec = ElfFile.getSection(0); in readSections() local
1831 if (!Sec) in readSections()
1832 return Sec.takeError(); in readSections()
1834 ShstrIndex = (*Sec)->sh_link; in readSections()
1840 Expected<StringTableSection *> Sec = in readSections() local
1847 if (!Sec) in readSections()
1848 return Sec.takeError(); in readSections()
1850 Obj.SectionNames = *Sec; in readSections()
1876 for (SectionBase &Sec : Obj.sections()) { in readSections()
1877 if (&Sec == Obj.SymbolTable) in readSections()
1879 if (Error Err = Sec.initialize(Obj.sections())) in readSections()
1881 if (auto RelSec = dyn_cast<RelocationSection>(&Sec)) { in readSections()
1914 } else if (auto GroupSec = dyn_cast<GroupSection>(&Sec)) { in readSections()
2109 for (SectionBase &Sec : Obj.sections()) in writeShdrs()
2110 writeShdr(Sec); in writeShdrs()
2114 for (SectionBase &Sec : Obj.sections()) in writeSectionData()
2118 if (Sec.ParentSegment == nullptr) in writeSectionData()
2119 if (Error Err = Sec.accept(*SecWriter)) in writeSectionData()
2133 SectionBase *Sec = it.first; in writeSegmentData() local
2136 auto *Parent = Sec->ParentSegment; in writeSegmentData()
2139 Sec->OriginalOffset - Parent->OriginalOffset + Parent->Offset; in writeSegmentData()
2144 for (auto &Sec : Obj.removedSections()) { in writeSegmentData() local
2145 Segment *Parent = Sec.ParentSegment; in writeSegmentData()
2146 if (Parent == nullptr || Sec.Type == SHT_NOBITS || Sec.Size == 0) in writeSegmentData()
2149 Sec.OriginalOffset - Parent->OriginalOffset + Parent->Offset; in writeSegmentData()
2150 std::memset(Buf->getBufferStart() + Offset, 0, Sec.Size); in writeSegmentData()
2162 [&](const SecPtr &Sec) { return Sec->Name == Name; }); in updateSection() argument
2195 std::begin(Sections), std::end(Sections), [=](const SecPtr &Sec) { in removeSections() argument
2196 if (ToRemove(*Sec)) in removeSections()
2200 if (isa<CompressedSection>(Sec)) in removeSections()
2202 if (auto RelSec = dyn_cast<RelocationSectionBase>(Sec.get())) { in removeSections()
2207 if (Sec->Type == ELF::SHT_GROUP) { in removeSections()
2208 auto GroupSec = cast<GroupSection>(Sec.get()); in removeSections()
2238 AllowBrokenLinks, [&RemoveSections](const SectionBase *Sec) { in removeSections() argument
2239 return RemoveSections.find(Sec) != RemoveSections.end(); in removeSections()
2265 for (auto &Sec : Sections) in replaceSections() local
2266 Sec->replaceSectionReferences(FromTo); in replaceSections()
2270 [=](const SectionBase &Sec) { return FromTo.count(&Sec) > 0; })) in replaceSections() argument
2278 for (const SecPtr &Sec : Sections) in removeSymbols() local
2279 if (Error E = Sec->removeSymbols(ToRemove)) in removeSymbols()
2289 for (SectionBase &Sec : sections()) { in addNewSymbolTable()
2290 if (Sec.Type == ELF::SHT_STRTAB && !(Sec.Flags & SHF_ALLOC)) { in addNewSymbolTable()
2291 StrTab = static_cast<StringTableSection *>(&Sec); in addNewSymbolTable()
2295 if (SectionNames != &Sec) in addNewSymbolTable()
2366 for (auto &Sec : Sections) { in layoutSections() local
2367 Sec.Index = Index++; in layoutSections()
2368 if (Sec.ParentSegment != nullptr) { in layoutSections()
2369 const Segment &Segment = *Sec.ParentSegment; in layoutSections()
2370 Sec.Offset = in layoutSections()
2371 Segment.Offset + (Sec.OriginalOffset - Segment.OriginalOffset); in layoutSections()
2373 OutOfSegmentSections.push_back(&Sec); in layoutSections()
2380 for (auto *Sec : OutOfSegmentSections) { in layoutSections() local
2381 Offset = alignTo(Offset, Sec->Align == 0 ? 1 : Sec->Align); in layoutSections()
2382 Sec->Offset = Offset; in layoutSections()
2383 if (Sec->Type != SHT_NOBITS) in layoutSections()
2384 Offset += Sec->Size; in layoutSections()
2397 for (auto &Sec : Obj.sections()) { in layoutSectionsForOnlyKeepDebug() local
2398 Sec.Index = Index++; in layoutSectionsForOnlyKeepDebug()
2399 Sections.push_back(&Sec); in layoutSectionsForOnlyKeepDebug()
2406 for (auto *Sec : Sections) { in layoutSectionsForOnlyKeepDebug() local
2407 auto *FirstSec = Sec->ParentSegment && Sec->ParentSegment->Type == PT_LOAD in layoutSectionsForOnlyKeepDebug()
2408 ? Sec->ParentSegment->firstSection() in layoutSectionsForOnlyKeepDebug()
2413 if (FirstSec && FirstSec == Sec) in layoutSectionsForOnlyKeepDebug()
2414 Off = alignTo(Off, Sec->ParentSegment->Align, Sec->Addr); in layoutSectionsForOnlyKeepDebug()
2419 if (Sec->Type == SHT_NOBITS) { in layoutSectionsForOnlyKeepDebug()
2420 Sec->Offset = Off; in layoutSectionsForOnlyKeepDebug()
2427 Off = Sec->Align ? alignTo(Off, Sec->Align) : Off; in layoutSectionsForOnlyKeepDebug()
2428 } else if (FirstSec != Sec) { in layoutSectionsForOnlyKeepDebug()
2431 Off = Sec->OriginalOffset - FirstSec->OriginalOffset + FirstSec->Offset; in layoutSectionsForOnlyKeepDebug()
2433 Sec->Offset = Off; in layoutSectionsForOnlyKeepDebug()
2434 Off += Sec->Size; in layoutSectionsForOnlyKeepDebug()
2459 for (const SectionBase *Sec : Seg->Sections) { in layoutSegmentsForOnlyKeepDebug() local
2460 uint64_t Size = Sec->Type == SHT_NOBITS ? 0 : Sec->Size; in layoutSegmentsForOnlyKeepDebug()
2461 if (Sec->Offset + Size > Offset) in layoutSegmentsForOnlyKeepDebug()
2462 FileSize = std::max(FileSize, Sec->Offset + Size - Offset); in layoutSegmentsForOnlyKeepDebug()
2565 return Obj.removeSections(false, [&](const SectionBase &Sec) { in removeUnneededSections() argument
2566 return &Sec == Obj.SymbolTable || &Sec == StrTab; in removeUnneededSections()
2585 for (SectionBase &Sec : Obj.sections()) in finalize()
2586 Sec.restoreSymTabLink(*Obj.SymbolTable); in finalize()
2598 [](const SectionBase &Sec) { return Sec.HasSymbol; }); in finalize() argument
2619 [this](const SectionBase &Sec) { in finalize() argument
2620 return &Sec == Obj.SectionIndexTable; in finalize()
2629 for (const SectionBase &Sec : Obj.sections()) in finalize() local
2630 Obj.SectionNames->addString(Sec.Name); in finalize()
2639 for (SectionBase &Sec : Obj.sections()) { in finalize()
2640 Sec.Index = Index++; in finalize()
2641 if (Error Err = Sec.accept(*SecSizer)) in finalize()
2653 for (SectionBase &Sec : Obj.sections()) in finalize()
2654 if (auto StrTab = dyn_cast<StringTableSection>(&Sec)) in finalize()
2667 for (SectionBase &Sec : Obj.sections()) { in finalize()
2668 Sec.HeaderOffset = Offset; in finalize()
2671 Sec.NameIndex = Obj.SectionNames->findIndex(Sec.Name); in finalize()
2672 Sec.finalize(); in finalize()
2688 for (const SectionBase &Sec : Obj.allocSections()) { in write() local
2689 if (Sec.Type != SHT_NOBITS && Sec.Size > 0) in write()
2690 SectionsToWrite.push_back(&Sec); in write()
2704 const SectionBase &Sec = *SectionsToWrite[i]; in write() local
2705 if (Error Err = Sec.accept(*SecWriter)) in write()
2713 assert(Sec.Offset + Sec.Size <= PadOffset); in write()
2714 std::fill(Buf->getBufferStart() + Sec.Offset + Sec.Size, in write()
2730 for (SectionBase &Sec : Obj.allocSections()) { in finalize()
2731 if (Sec.ParentSegment != nullptr) in finalize()
2732 Sec.Addr = in finalize()
2733 Sec.Offset - Sec.ParentSegment->Offset + Sec.ParentSegment->PAddr; in finalize()
2734 if (Sec.Type != SHT_NOBITS && Sec.Size > 0) in finalize()
2735 MinAddr = std::min(MinAddr, Sec.Addr); in finalize()
2743 for (SectionBase &Sec : Obj.allocSections()) in finalize()
2744 if (Sec.Type != SHT_NOBITS && Sec.Size > 0) { in finalize()
2745 Sec.Offset = Sec.Addr - MinAddr; in finalize()
2746 TotalSize = std::max(TotalSize, Sec.Offset + Sec.Size); in finalize()
2836 for (const SectionBase *Sec : Sections) in getTotalSize() local
2837 if (Error Err = Sec->accept(LengthCalc)) in getTotalSize()
2850 for (const SectionBase *Sec : Sections) in write() local
2851 if (Error Err = Sec->accept(Writer)) in write()
2869 Error SRECSectionWriterBase::visit(const StringTableSection &Sec) { in visit() argument
2871 assert(Sec.Size == Sec.StrTabBuilder.getSize() && in visit()
2878 Error SRECSectionWriterBase::visit(const Section &Sec) { in visit() argument
2879 writeSection(Sec, Sec.Contents); in visit()
2883 Error SRECSectionWriterBase::visit(const OwnedDataSection &Sec) { in visit() argument
2884 writeSection(Sec, Sec.Data); in visit()
2888 Error SRECSectionWriterBase::visit(const DynamicRelocationSection &Sec) { in visit() argument
2889 writeSection(Sec, Sec.Contents); in visit()
2926 Error SRECSectionWriter::visit(const StringTableSection &Sec) { in visit() argument
2927 assert(Sec.Size == Sec.StrTabBuilder.getSize() && in visit()
2929 std::vector<uint8_t> Data(Sec.Size); in visit()
2930 Sec.StrTabBuilder.write(Data.data()); in visit()
2931 writeSection(Sec, Data); in visit()
3029 for (const SectionBase *Sec : Sections) in getTotalSize() local
3030 if (Error Err = Sec->accept(SizeCalc)) in getTotalSize()