Lines Matching refs:Sec
67 template <class ELFT> void ELFWriter<ELFT>::writeShdr(const SectionBase &Sec) { in writeShdr() argument
69 reinterpret_cast<uint8_t *>(Buf->getBufferStart()) + Sec.HeaderOffset; in writeShdr()
71 Shdr.sh_name = Sec.NameIndex; in writeShdr()
72 Shdr.sh_type = Sec.Type; in writeShdr()
73 Shdr.sh_flags = Sec.Flags; in writeShdr()
74 Shdr.sh_addr = Sec.Addr; in writeShdr()
75 Shdr.sh_offset = Sec.Offset; in writeShdr()
76 Shdr.sh_size = Sec.Size; in writeShdr()
77 Shdr.sh_link = Sec.Link; in writeShdr()
78 Shdr.sh_info = Sec.Info; in writeShdr()
79 Shdr.sh_addralign = Sec.Align; in writeShdr()
80 Shdr.sh_entsize = Sec.EntrySize; in writeShdr()
101 Error ELFSectionSizer<ELFT>::visit(SymbolTableSection &Sec) { in visit() argument
102 Sec.EntrySize = sizeof(Elf_Sym); in visit()
103 Sec.Size = Sec.Symbols.size() * Sec.EntrySize; in visit()
105 Sec.Align = ELFT::Is64Bits ? sizeof(Elf_Xword) : sizeof(Elf_Word); in visit()
110 Error ELFSectionSizer<ELFT>::visit(RelocationSection &Sec) { in visit() argument
111 Sec.EntrySize = Sec.Type == SHT_REL ? sizeof(Elf_Rel) : sizeof(Elf_Rela); in visit()
112 Sec.Size = Sec.Relocations.size() * Sec.EntrySize; in visit()
114 Sec.Align = ELFT::Is64Bits ? sizeof(Elf_Xword) : sizeof(Elf_Word); in visit()
123 template <class ELFT> Error ELFSectionSizer<ELFT>::visit(GroupSection &Sec) { in visit() argument
124 Sec.Size = sizeof(Elf_Word) + Sec.GroupMembers.size() * sizeof(Elf_Word); in visit()
142 Error BinarySectionWriter::visit(const SectionIndexSection &Sec) { in visit() argument
145 Sec.Name + "' "); in visit()
148 Error BinarySectionWriter::visit(const SymbolTableSection &Sec) { in visit() argument
150 "cannot write symbol table '" + Sec.Name + in visit()
154 Error BinarySectionWriter::visit(const RelocationSection &Sec) { in visit() argument
156 "cannot write relocation section '" + Sec.Name + in visit()
160 Error BinarySectionWriter::visit(const GnuDebugLinkSection &Sec) { in visit() argument
162 "cannot write '" + Sec.Name + "' out to binary"); in visit()
165 Error BinarySectionWriter::visit(const GroupSection &Sec) { in visit() argument
167 "cannot write '" + Sec.Name + "' out to binary"); in visit()
170 Error SectionWriter::visit(const Section &Sec) { in visit() argument
171 if (Sec.Type != SHT_NOBITS) in visit()
172 llvm::copy(Sec.Contents, Out.getBufferStart() + Sec.Offset); in visit()
327 static uint64_t sectionPhysicalAddr(const SectionBase *Sec) { in sectionPhysicalAddr() argument
328 Segment *Seg = Sec->ParentSegment; in sectionPhysicalAddr()
331 return Seg ? Seg->PAddr + Sec->OriginalOffset - Seg->OriginalOffset in sectionPhysicalAddr()
332 : Sec->Addr; in sectionPhysicalAddr()
335 void IHexSectionWriterBase::writeSection(const SectionBase *Sec, in writeSection() argument
337 assert(Data.size() == Sec->Size); in writeSection()
339 uint32_t Addr = sectionPhysicalAddr(Sec) & 0xFFFFFFFFU; in writeSection()
384 Error IHexSectionWriterBase::visit(const Section &Sec) { in visit() argument
385 writeSection(&Sec, Sec.Contents); in visit()
389 Error IHexSectionWriterBase::visit(const OwnedDataSection &Sec) { in visit() argument
390 writeSection(&Sec, Sec.Data); in visit()
394 Error IHexSectionWriterBase::visit(const StringTableSection &Sec) { in visit() argument
396 assert(Sec.Size == Sec.StrTabBuilder.getSize()); in visit()
400 writeSection(&Sec, {nullptr, static_cast<size_t>(Sec.Size)}); in visit()
404 Error IHexSectionWriterBase::visit(const DynamicRelocationSection &Sec) { in visit() argument
405 writeSection(&Sec, Sec.Contents); in visit()
416 Error IHexSectionWriter::visit(const StringTableSection &Sec) { in visit() argument
417 assert(Sec.Size == Sec.StrTabBuilder.getSize()); in visit()
418 std::vector<uint8_t> Data(Sec.Size); in visit()
419 Sec.StrTabBuilder.write(Data.data()); in visit()
420 writeSection(&Sec, Data); in visit()
439 Error SectionWriter::visit(const OwnedDataSection &Sec) { in visit() argument
440 llvm::copy(Sec.Data, Out.getBufferStart() + Sec.Offset); in visit()
445 Error ELFSectionWriter<ELFT>::visit(const DecompressedSection &Sec) { in visit() argument
447 Sec.OriginalData.slice(sizeof(Elf_Chdr_Impl<ELFT>)); in visit()
450 switch (Sec.ChType) { in visit()
460 Twine(Sec.ChType) + ") of section '" + in visit()
461 Sec.Name + "' is unsupported"); in visit()
466 "failed to decompress section '" + Sec.Name + in visit()
469 static_cast<size_t>(Sec.Size))) in visit()
471 "failed to decompress section '" + Sec.Name + in visit()
474 uint8_t *Buf = reinterpret_cast<uint8_t *>(Out.getBufferStart()) + Sec.Offset; in visit()
480 Error BinarySectionWriter::visit(const DecompressedSection &Sec) { in visit() argument
482 "cannot write compressed section '" + Sec.Name + in visit()
511 Error BinarySectionWriter::visit(const CompressedSection &Sec) { in visit() argument
513 "cannot write compressed section '" + Sec.Name + in visit()
518 Error ELFSectionWriter<ELFT>::visit(const CompressedSection &Sec) { in visit() argument
519 uint8_t *Buf = reinterpret_cast<uint8_t *>(Out.getBufferStart()) + Sec.Offset; in visit()
521 switch (Sec.CompressionType) { in visit()
523 std::copy(Sec.OriginalData.begin(), Sec.OriginalData.end(), Buf); in visit()
532 Chdr.ch_size = Sec.DecompressedSize; in visit()
533 Chdr.ch_addralign = Sec.DecompressedAlign; in visit()
537 std::copy(Sec.CompressedData.begin(), Sec.CompressedData.end(), Buf); in visit()
541 CompressedSection::CompressedSection(const SectionBase &Sec, in CompressedSection() argument
544 : SectionBase(Sec), CompressionType(CompressionType), in CompressedSection()
545 DecompressedSize(Sec.OriginalData.size()), DecompressedAlign(Sec.Align) { in CompressedSection()
583 Error SectionWriter::visit(const StringTableSection &Sec) { in visit() argument
584 Sec.StrTabBuilder.write(reinterpret_cast<uint8_t *>(Out.getBufferStart()) + in visit()
585 Sec.Offset); in visit()
598 Error ELFSectionWriter<ELFT>::visit(const SectionIndexSection &Sec) { in visit() argument
599 uint8_t *Buf = reinterpret_cast<uint8_t *>(Out.getBufferStart()) + Sec.Offset; in visit()
600 llvm::copy(Sec.Indexes, reinterpret_cast<Elf_Word *>(Buf)); in visit()
606 Expected<SymbolTableSection *> Sec = in initialize() local
613 if (!Sec) in initialize()
614 return Sec.takeError(); in initialize()
616 setSymTab(*Sec); in initialize()
771 Expected<StringTableSection *> Sec = in initialize() local
778 if (!Sec) in initialize()
779 return Sec.takeError(); in initialize()
781 setStrTab(*Sec); in initialize()
845 Error ELFSectionWriter<ELFT>::visit(const SymbolTableSection &Sec) { in visit() argument
846 Elf_Sym *Sym = reinterpret_cast<Elf_Sym *>(Out.getBufferStart() + Sec.Offset); in visit()
848 for (const std::unique_ptr<Symbol> &Symbol : Sec.Symbols) { in visit()
911 Expected<SymTabType *> Sec = SecTable.getSectionOfType<SymTabType>( in initialize() local
917 if (!Sec) in initialize()
918 return Sec.takeError(); in initialize()
920 setSymTab(*Sec); in initialize()
924 Expected<SectionBase *> Sec = in initialize() local
927 if (!Sec) in initialize()
928 return Sec.takeError(); in initialize()
930 setSection(*Sec); in initialize()
965 Error ELFSectionWriter<ELFT>::visit(const RelocationSection &Sec) { in visit() argument
966 uint8_t *Buf = reinterpret_cast<uint8_t *>(Out.getBufferStart()) + Sec.Offset; in visit()
967 if (Sec.Type == SHT_REL) in visit()
968 writeRel(Sec.Relocations, reinterpret_cast<Elf_Rel *>(Buf), in visit()
969 Sec.getObject().IsMips64EL); in visit()
971 writeRel(Sec.Relocations, reinterpret_cast<Elf_Rela *>(Buf), in visit()
972 Sec.getObject().IsMips64EL); in visit()
1008 Error SectionWriter::visit(const DynamicRelocationSection &Sec) { in visit() argument
1009 llvm::copy(Sec.Contents, Out.getBufferStart() + Sec.Offset); in visit()
1098 for (SectionBase *&Sec : GroupMembers) in replaceSectionReferences()
1099 if (SectionBase *To = FromTo.lookup(Sec)) in replaceSectionReferences()
1100 Sec = To; in replaceSectionReferences()
1106 for (SectionBase *Sec : GroupMembers) in onRemove()
1107 Sec->Flags &= ~SHF_GROUP; in onRemove()
1114 Expected<SectionBase *> Sec = in initialize() local
1117 if (!Sec) in initialize()
1118 return Sec.takeError(); in initialize()
1120 LinkSection = *Sec; in initialize()
1156 Error ELFSectionWriter<ELFT>::visit(const GnuDebugLinkSection &Sec) { in visit() argument
1158 reinterpret_cast<uint8_t *>(Out.getBufferStart()) + Sec.Offset; in visit()
1160 reinterpret_cast<Elf_Word *>(Buf + Sec.Size - sizeof(Elf_Word)); in visit()
1161 *CRC = Sec.CRC32; in visit()
1162 llvm::copy(Sec.FileName, Buf); in visit()
1175 Error ELFSectionWriter<ELFT>::visit(const GroupSection &Sec) { in visit() argument
1177 reinterpret_cast<ELF::Elf32_Word *>(Out.getBufferStart() + Sec.Offset); in visit()
1178 support::endian::write32<ELFT::TargetEndianness>(Buf++, Sec.FlagWord); in visit()
1179 for (SectionBase *S : Sec.GroupMembers) in visit()
1193 static bool sectionWithinSegment(const SectionBase &Sec, const Segment &Seg) { in sectionWithinSegment() argument
1198 uint64_t SecSize = Sec.Size ? Sec.Size : 1; in sectionWithinSegment()
1201 if (Sec.OriginalOffset == std::numeric_limits<uint64_t>::max()) in sectionWithinSegment()
1204 if (Sec.Type == SHT_NOBITS) { in sectionWithinSegment()
1205 if (!(Sec.Flags & SHF_ALLOC)) in sectionWithinSegment()
1208 bool SectionIsTLS = Sec.Flags & SHF_TLS; in sectionWithinSegment()
1213 return Seg.VAddr <= Sec.Addr && in sectionWithinSegment()
1214 Seg.VAddr + Seg.MemSize >= Sec.Addr + SecSize; in sectionWithinSegment()
1217 return Seg.Offset <= Sec.OriginalOffset && in sectionWithinSegment()
1218 Seg.Offset + Seg.FileSize >= Sec.OriginalOffset + SecSize; in sectionWithinSegment()
1274 for (SectionBase &Sec : Obj->sections()) in initSections()
1275 if (Error Err = Sec.initialize(Obj->sections())) in initSections()
1406 for (const SectionBase &Sec : Obj.sections()) { in findEhdrOffset() local
1407 if (Sec.Type == SHT_LLVM_PART_EHDR && Sec.Name == *ExtractPartition) { in findEhdrOffset()
1408 EhdrOffset = Sec.Offset; in findEhdrOffset()
1447 for (SectionBase &Sec : Obj.sections()) in readProgramHeaders()
1448 if (sectionWithinSegment(Sec, Seg)) { in readProgramHeaders()
1449 Seg.addSection(&Sec); in readProgramHeaders()
1450 if (!Sec.ParentSegment || Sec.ParentSegment->Offset > Seg.Offset) in readProgramHeaders()
1451 Sec.ParentSegment = &Seg; in readProgramHeaders()
1523 Expected<SectionBase *> Sec = SecTable.getSection( in initGroupSection() local
1526 if (!Sec) in initGroupSection()
1527 return Sec.takeError(); in initGroupSection()
1529 GroupSec->addMember(*Sec); in initGroupSection()
1584 Expected<SectionBase *> Sec = Obj.sections().getSection( in initSymbolTable() local
1587 if (!Sec) in initSymbolTable()
1588 return Sec.takeError(); in initSymbolTable()
1590 DefSection = *Sec; in initSymbolTable()
1601 Expected<SectionBase *> Sec = Obj.sections().getSection( in initSymbolTable() local
1605 if (!Sec) in initSymbolTable()
1606 return Sec.takeError(); in initSymbolTable()
1608 DefSection = *Sec; in initSymbolTable()
1669 if (T *Sec = dyn_cast<T>(*BaseSec)) in getSectionOfType() local
1670 return Sec; in getSectionOfType()
1767 Expected<SectionBase &> Sec = makeSection(Shdr); in readSectionHeaders() local
1768 if (!Sec) in readSectionHeaders()
1769 return Sec.takeError(); in readSectionHeaders()
1774 Sec->Name = SecName->str(); in readSectionHeaders()
1775 Sec->Type = Sec->OriginalType = Shdr.sh_type; in readSectionHeaders()
1776 Sec->Flags = Sec->OriginalFlags = Shdr.sh_flags; in readSectionHeaders()
1777 Sec->Addr = Shdr.sh_addr; in readSectionHeaders()
1778 Sec->Offset = Shdr.sh_offset; in readSectionHeaders()
1779 Sec->OriginalOffset = Shdr.sh_offset; in readSectionHeaders()
1780 Sec->Size = Shdr.sh_size; in readSectionHeaders()
1781 Sec->Link = Shdr.sh_link; in readSectionHeaders()
1782 Sec->Info = Shdr.sh_info; in readSectionHeaders()
1783 Sec->Align = Shdr.sh_addralign; in readSectionHeaders()
1784 Sec->EntrySize = Shdr.sh_entsize; in readSectionHeaders()
1785 Sec->Index = Index++; in readSectionHeaders()
1786 Sec->OriginalIndex = Sec->Index; in readSectionHeaders()
1787 Sec->OriginalData = ArrayRef<uint8_t>( in readSectionHeaders()
1798 Expected<const Elf_Shdr *> Sec = ElfFile.getSection(0); in readSections() local
1799 if (!Sec) in readSections()
1800 return Sec.takeError(); in readSections()
1802 ShstrIndex = (*Sec)->sh_link; in readSections()
1808 Expected<StringTableSection *> Sec = in readSections() local
1815 if (!Sec) in readSections()
1816 return Sec.takeError(); in readSections()
1818 Obj.SectionNames = *Sec; in readSections()
1844 for (SectionBase &Sec : Obj.sections()) { in readSections()
1845 if (&Sec == Obj.SymbolTable) in readSections()
1847 if (Error Err = Sec.initialize(Obj.sections())) in readSections()
1849 if (auto RelSec = dyn_cast<RelocationSection>(&Sec)) { in readSections()
1874 } else if (auto GroupSec = dyn_cast<GroupSection>(&Sec)) { in readSections()
2070 for (SectionBase &Sec : Obj.sections()) in writeShdrs()
2071 writeShdr(Sec); in writeShdrs()
2075 for (SectionBase &Sec : Obj.sections()) in writeSectionData()
2079 if (Sec.ParentSegment == nullptr) in writeSectionData()
2080 if (Error Err = Sec.accept(*SecWriter)) in writeSectionData()
2094 SectionBase *Sec = it.first; in writeSegmentData() local
2097 auto *Parent = Sec->ParentSegment; in writeSegmentData()
2100 Sec->OriginalOffset - Parent->OriginalOffset + Parent->Offset; in writeSegmentData()
2105 for (auto &Sec : Obj.removedSections()) { in writeSegmentData() local
2106 Segment *Parent = Sec.ParentSegment; in writeSegmentData()
2107 if (Parent == nullptr || Sec.Type == SHT_NOBITS || Sec.Size == 0) in writeSegmentData()
2110 Sec.OriginalOffset - Parent->OriginalOffset + Parent->Offset; in writeSegmentData()
2111 std::memset(Buf->getBufferStart() + Offset, 0, Sec.Size); in writeSegmentData()
2123 [&](const SecPtr &Sec) { return Sec->Name == Name; }); in updateSection() argument
2156 std::begin(Sections), std::end(Sections), [=](const SecPtr &Sec) { in removeSections() argument
2157 if (ToRemove(*Sec)) in removeSections()
2159 if (auto RelSec = dyn_cast<RelocationSectionBase>(Sec.get())) { in removeSections()
2190 AllowBrokenLinks, [&RemoveSections](const SectionBase *Sec) { in removeSections() argument
2191 return RemoveSections.find(Sec) != RemoveSections.end(); in removeSections()
2217 for (auto &Sec : Sections) in replaceSections() local
2218 Sec->replaceSectionReferences(FromTo); in replaceSections()
2222 [=](const SectionBase &Sec) { return FromTo.count(&Sec) > 0; })) in replaceSections() argument
2230 for (const SecPtr &Sec : Sections) in removeSymbols() local
2231 if (Error E = Sec->removeSymbols(ToRemove)) in removeSymbols()
2241 for (SectionBase &Sec : sections()) { in addNewSymbolTable()
2242 if (Sec.Type == ELF::SHT_STRTAB && !(Sec.Flags & SHF_ALLOC)) { in addNewSymbolTable()
2243 StrTab = static_cast<StringTableSection *>(&Sec); in addNewSymbolTable()
2247 if (SectionNames != &Sec) in addNewSymbolTable()
2318 for (auto &Sec : Sections) { in layoutSections() local
2319 Sec.Index = Index++; in layoutSections()
2320 if (Sec.ParentSegment != nullptr) { in layoutSections()
2321 const Segment &Segment = *Sec.ParentSegment; in layoutSections()
2322 Sec.Offset = in layoutSections()
2323 Segment.Offset + (Sec.OriginalOffset - Segment.OriginalOffset); in layoutSections()
2325 OutOfSegmentSections.push_back(&Sec); in layoutSections()
2332 for (auto *Sec : OutOfSegmentSections) { in layoutSections() local
2333 Offset = alignTo(Offset, Sec->Align == 0 ? 1 : Sec->Align); in layoutSections()
2334 Sec->Offset = Offset; in layoutSections()
2335 if (Sec->Type != SHT_NOBITS) in layoutSections()
2336 Offset += Sec->Size; in layoutSections()
2349 for (auto &Sec : Obj.sections()) { in layoutSectionsForOnlyKeepDebug() local
2350 Sec.Index = Index++; in layoutSectionsForOnlyKeepDebug()
2351 Sections.push_back(&Sec); in layoutSectionsForOnlyKeepDebug()
2358 for (auto *Sec : Sections) { in layoutSectionsForOnlyKeepDebug() local
2359 auto *FirstSec = Sec->ParentSegment && Sec->ParentSegment->Type == PT_LOAD in layoutSectionsForOnlyKeepDebug()
2360 ? Sec->ParentSegment->firstSection() in layoutSectionsForOnlyKeepDebug()
2365 if (FirstSec && FirstSec == Sec) in layoutSectionsForOnlyKeepDebug()
2366 Off = alignTo(Off, Sec->ParentSegment->Align, Sec->Addr); in layoutSectionsForOnlyKeepDebug()
2371 if (Sec->Type == SHT_NOBITS) { in layoutSectionsForOnlyKeepDebug()
2372 Sec->Offset = Off; in layoutSectionsForOnlyKeepDebug()
2379 Off = Sec->Align ? alignTo(Off, Sec->Align) : Off; in layoutSectionsForOnlyKeepDebug()
2380 } else if (FirstSec != Sec) { in layoutSectionsForOnlyKeepDebug()
2383 Off = Sec->OriginalOffset - FirstSec->OriginalOffset + FirstSec->Offset; in layoutSectionsForOnlyKeepDebug()
2385 Sec->Offset = Off; in layoutSectionsForOnlyKeepDebug()
2386 Off += Sec->Size; in layoutSectionsForOnlyKeepDebug()
2411 for (const SectionBase *Sec : Seg->Sections) { in layoutSegmentsForOnlyKeepDebug() local
2412 uint64_t Size = Sec->Type == SHT_NOBITS ? 0 : Sec->Size; in layoutSegmentsForOnlyKeepDebug()
2413 if (Sec->Offset + Size > Offset) in layoutSegmentsForOnlyKeepDebug()
2414 FileSize = std::max(FileSize, Sec->Offset + Size - Offset); in layoutSegmentsForOnlyKeepDebug()
2517 return Obj.removeSections(false, [&](const SectionBase &Sec) { in removeUnneededSections() argument
2518 return &Sec == Obj.SymbolTable || &Sec == StrTab; in removeUnneededSections()
2537 for (SectionBase &Sec : Obj.sections()) in finalize()
2538 Sec.restoreSymTabLink(*Obj.SymbolTable); in finalize()
2550 [](const SectionBase &Sec) { return Sec.HasSymbol; }); in finalize() argument
2571 [this](const SectionBase &Sec) { in finalize() argument
2572 return &Sec == Obj.SectionIndexTable; in finalize()
2581 for (const SectionBase &Sec : Obj.sections()) in finalize() local
2582 Obj.SectionNames->addString(Sec.Name); in finalize()
2591 for (SectionBase &Sec : Obj.sections()) { in finalize()
2592 Sec.Index = Index++; in finalize()
2593 if (Error Err = Sec.accept(*SecSizer)) in finalize()
2605 for (SectionBase &Sec : Obj.sections()) in finalize()
2606 if (auto StrTab = dyn_cast<StringTableSection>(&Sec)) in finalize()
2619 for (SectionBase &Sec : Obj.sections()) { in finalize()
2620 Sec.HeaderOffset = Offset; in finalize()
2623 Sec.NameIndex = Obj.SectionNames->findIndex(Sec.Name); in finalize()
2624 Sec.finalize(); in finalize()
2640 for (const SectionBase &Sec : Obj.allocSections()) { in write() local
2641 if (Sec.Type != SHT_NOBITS && Sec.Size > 0) in write()
2642 SectionsToWrite.push_back(&Sec); in write()
2656 const SectionBase &Sec = *SectionsToWrite[i]; in write() local
2657 if (Error Err = Sec.accept(*SecWriter)) in write()
2665 assert(Sec.Offset + Sec.Size <= PadOffset); in write()
2666 std::fill(Buf->getBufferStart() + Sec.Offset + Sec.Size, in write()
2682 for (SectionBase &Sec : Obj.allocSections()) { in finalize()
2683 if (Sec.ParentSegment != nullptr) in finalize()
2684 Sec.Addr = in finalize()
2685 Sec.Offset - Sec.ParentSegment->Offset + Sec.ParentSegment->PAddr; in finalize()
2686 if (Sec.Type != SHT_NOBITS && Sec.Size > 0) in finalize()
2687 MinAddr = std::min(MinAddr, Sec.Addr); in finalize()
2695 for (SectionBase &Sec : Obj.allocSections()) in finalize()
2696 if (Sec.Type != SHT_NOBITS && Sec.Size > 0) { in finalize()
2697 Sec.Offset = Sec.Addr - MinAddr; in finalize()
2698 TotalSize = std::max(TotalSize, Sec.Offset + Sec.Size); in finalize()
2746 for (const SectionBase *Sec : Sections) in write() local
2747 if (Error Err = Sec->accept(Writer)) in write()
2765 Error IHexWriter::checkSection(const SectionBase &Sec) { in checkSection() argument
2766 uint64_t Addr = sectionPhysicalAddr(&Sec); in checkSection()
2767 if (addressOverflows32bit(Addr) || addressOverflows32bit(Addr + Sec.Size - 1)) in checkSection()
2771 Sec.Name.c_str(), Addr, Addr + Sec.Size - 1); in checkSection()
2782 for (const SectionBase &Sec : Obj.sections()) in finalize() local
2783 if ((Sec.Flags & ELF::SHF_ALLOC) && Sec.Type != ELF::SHT_NOBITS && in finalize()
2784 Sec.Size > 0) { in finalize()
2785 if (Error E = checkSection(Sec)) in finalize()
2787 Sections.insert(&Sec); in finalize()
2797 for (const SectionBase *Sec : Sections) in finalize() local
2798 if (Error Err = Sec->accept(LengthCalc)) in finalize()