Lines Matching defs:sections

10 // identify and merge two or more read-only sections (typically functions)
14 // In ICF, two sections are considered identical if they have the same
17 // relocation types, values, and if they point to the same sections *in
31 // What we are doing in LLD is to partition sections into equivalence
35 // 1. First, we partition sections using their hash values as keys. Hash
38 // account. We just put sections that apparently differ into different
41 // 2. Next, for each equivalence class, we visit sections to compare
53 // merge all the other sections in C with it.
125 SmallVector<InputSection *, 0> sections;
141 // other equivalence classes in parallel. They may read sections that we
143 // it breaks the invariance that all possibly-identical sections must be
167 // Don't merge writable sections. .data.rel.ro sections are marked as writable
173 // SHF_LINK_ORDER sections are ICF'd as a unit with their dependent sections,
178 // Don't merge synthetic sections as their Data member is not valid and empty.
189 // A user program may enumerate sections named with a C identifier using
190 // __start_* and __stop_* symbols. We cannot ICF any such sections because
202 // This loop rearranges sections in [Begin, End) so that all sections
207 // issue in practice because the number of the distinct sections in
214 std::stable_partition(sections.begin() + begin + 1,
215 sections.begin() + end, [&](InputSection *s) {
217 return equalsConstant(sections[begin], s);
218 return equalsVariable(sections[begin], s);
220 size_t mid = bound - sections.begin();
223 // updating the sections in [Begin, Mid). We use Mid as the basis for
227 sections[i]->eqClass[next] = eqClassBase + mid;
270 // and either symbol is preemptible, the containing sections should be
271 // considered different. This is because even if the sections are identical
322 // If two sections have different output sections, we cannot merge them.
346 // The two sections must be identical.
389 uint32_t eqClass = sections[begin]->eqClass[current];
391 if (eqClass != sections[i]->eqClass[current])
398 // groups of sections, grouped by the class.
414 // If threading is disabled or the number of sections are
416 if (parallel::strategy.ThreadsRequested == 1 || sections.size() < 1024) {
417 forEachClassRange(0, sections.size(), fn);
430 size_t step = sections.size() / numShards;
433 boundaries[numShards] = sections.size();
436 boundaries[i] = findBoundary((i - 1) * step, sections.size());
446 // Combine the hashes of the sections referenced by the given section into its
464 // Two text sections may have identical content and relocations but different
477 // Collect sections to merge.
482 sections.push_back(s);
484 // Ineligible sections are assigned unique IDs, i.e. each section
490 // Initially, we use hash values to partition sections.
491 parallelForEach(sections, [&](InputSection *s) {
500 parallelForEach(sections, [&](InputSection *s) {
511 // From now on, sections in Sections vector are ordered so that sections
513 llvm::stable_sort(sections, [](const InputSection *a, const InputSection *b) {
538 // Merge sections by the equivalence class.
539 forEachClassRange(0, sections.size(), [&](size_t begin, size_t end) {
542 print() << "selected section " << sections[begin];
544 print() << " removing identical section " << sections[i];
545 sections[begin]->replace(sections[i]);
547 // At this point we know sections merged are fully identical and hence
549 // and relocation sections.
550 for (InputSection *isec : sections[i]->dependentSections)
571 // InputSectionDescription::sections is populated by processSectionCommands().
572 // ICF may fold some input sections assigned to output sections. Remove them.
577 llvm::erase_if(isd->sections,