Lines Matching full:sections

478                              "--decompress-debug-sections: ch_type (" +
820 // layout sections correctly. We will fill the table with correct
1061 // sections we also remove their relocation sections. Since we do that much
1169 // For sections not found in segments, OriginalOffset is only used to
1170 // establish the order that sections should go in. By using the maximum
1226 // Ignore just added sections.
1306 for (SectionBase &Sec : Obj->sections())
1307 if (Error Err = Sec.initialize(Obj->sections()))
1350 // Adds sections from IHEX data file. Data should have been
1366 // OriginalOffset field is only used to sort sections before layout, so
1438 for (const SectionBase &Sec : Obj.sections()) {
1479 for (SectionBase &Sec : Obj.sections())
1522 SectionTableRef SecTable = Obj.sections();
1615 Expected<SectionBase *> Sec = Obj.sections().getSection(
1632 Expected<SectionBase *> Sec = Obj.sections().getSection(
1687 if (Index == SHN_UNDEF || Index > Sections.size())
1689 return Sections[Index - 1].get();
1754 // Multiple SHT_SYMTAB sections are forbidden by the ELF gABI.
1757 "found multiple SHT_SYMTAB sections");
1789 Expected<typename ELFFile<ELFT>::Elf_Shdr_Range> Sections =
1790 ElfFile.sections();
1791 if (!Sections)
1792 return Sections.takeError();
1794 for (const typename ELFFile<ELFT>::Elf_Shdr &Shdr : *Sections) {
1841 Obj.sections().template getSectionOfType<StringTableSection>(
1857 if (Error Err = Obj.SectionIndexTable->initialize(Obj.sections()))
1860 // Now that all of the sections have been added we can fill out some extra
1864 if (Error Err = Obj.SymbolTable->initialize(Obj.sections()))
1873 // Now that all sections and symbols have been added we can add
1875 // relocation sections.
1876 for (SectionBase &Sec : Obj.sections()) {
1879 if (Error Err = Sec.initialize(Obj.sections()))
1882 Expected<typename ELFFile<ELFT>::Elf_Shdr_Range> Sections =
1883 ElfFile.sections();
1884 if (!Sections)
1885 return Sections.takeError();
1888 Sections->begin() + RelSec->Index;
1982 return parseError(-1U, "no sections");
2047 if (WriteSectionHeaders && Obj.sections().size() != 0) {
2051 // If the number of sections is greater than or equal to
2056 auto Shnum = Obj.sections().size() + 1;
2095 uint64_t Shnum = Obj.sections().size() + 1;
2109 for (SectionBase &Sec : Obj.sections())
2114 for (SectionBase &Sec : Obj.sections())
2117 // sections in segments effectively immutable.
2143 // Iterate over removed sections and overwrite their old data with zeroes.
2161 auto It = llvm::find_if(Sections,
2163 if (It == Sections.end())
2195 std::begin(Sections), std::end(Sections), [=](const SecPtr &Sec) {
2206 // Remove empty group sections.
2219 // Now make sure there are no remaining references to the sections that will
2223 RemoveSections.reserve(std::distance(Iter, std::end(Sections)));
2224 for (auto &RemoveSec : make_range(Iter, std::end(Sections))) {
2236 for (auto &KeepSec : make_range(std::begin(Sections), Iter)) {
2244 // Transfer removed sections into the Object RemovedSections container for use
2246 std::move(Iter, Sections.end(), std::back_inserter(RemovedSections));
2248 Sections.erase(Iter, std::end(Sections));
2257 assert(llvm::is_sorted(Sections, SectionIndexLess) &&
2258 "Sections are expected to be sorted by Index");
2259 // Set indices of new sections so that they can be later sorted into positions
2264 // Notify all sections about the replacement.
2265 for (auto &Sec : Sections)
2272 llvm::sort(Sections, SectionIndexLess);
2278 for (const SecPtr &Sec : Sections)
2289 for (SectionBase &Sec : sections()) {
2305 if (Error Err = SymTab.initialize(sections()))
2348 // This function finds a consistent layout for a list of sections. It assumes
2352 // sections had a ParentSegment or an offset one past the last section if there
2355 static uint64_t layoutSections(Range Sections, uint64_t Offset) {
2357 // of each section. For sections that are covered by a segment we should use
2360 // of the segment we can assign a new offset to the section. For sections not
2362 // While it is not necessary, layout the sections in the order based on their
2366 for (auto &Sec : Sections) {
2389 // Rewrite sh_offset after some sections are changed to SHT_NOBITS and thus
2392 // The layout algorithm requires the sections to be handled in the order of
2394 std::vector<SectionBase *> Sections;
2395 Sections.reserve(Obj.sections().size());
2397 for (auto &Sec : Obj.sections()) {
2399 Sections.push_back(&Sec);
2401 llvm::stable_sort(Sections,
2406 for (auto *Sec : Sections) {
2416 // sh_offset is not significant for SHT_NOBITS sections, but the congruence
2430 // sh_offset for non-SHF_ALLOC sections.
2459 for (const SectionBase *Sec : Seg->Sections) {
2503 // For --only-keep-debug, the sections that did not preserve contents were
2504 // changed to SHT_NOBITS. We now rewrite sh_offset fields of sections, and
2516 Offset = layoutSections(Obj.sections(), Offset);
2530 size_t ShdrCount = Obj.sections().size() + 1; // Includes null shdr.
2553 // Relocatable objects typically have relocation sections whose
2583 // .symtab for sections that were linked to .symtab.
2585 for (SectionBase &Sec : Obj.sections())
2592 if (Obj.sections().size() >= SHN_LORESERVE) {
2593 SectionTableRef Sections = Obj.sections();
2594 // Sections doesn't include the null section header, so account for this
2595 // when skipping the first N sections.
2597 any_of(drop_begin(Sections, SHN_LORESERVE - 1),
2608 // other sections and assigns the correct index to the new section.
2617 // We do not support sections referring to the section index table.
2626 // Make sure we add the names of all the sections. Importantly this must be
2629 for (const SectionBase &Sec : Obj.sections())
2639 for (SectionBase &Sec : Obj.sections()) {
2645 // The symbol table does not update all other sections on update. For
2647 // that some sections, like .strtab, don't yet have their final size.
2653 for (SectionBase &Sec : Obj.sections())
2667 for (SectionBase &Sec : Obj.sections()) {
2727 // sections as MinAddr. In the output, the contents between address 0 and
2775 for (const SectionBase &S : Obj.sections()) {
2779 Sections.push_back(&S);
2783 llvm::sort(Sections, [](const SectionBase *A, const SectionBase *B) {
2836 for (const SectionBase *Sec : Sections)
2849 // Write sections.
2850 for (const SectionBase *Sec : Sections)
2899 // The ELF header could contain an entry point outside of the sections we have
3029 for (const SectionBase *Sec : Sections)
3045 for (const SectionBase *S : Sections) {