Lines Matching full:sections
109 // Clear OutputSection::ptLoad for sections contained in removed
192 // combines the typical ELF GOT with the small data sections. It commonly
270 // In addition, demote symbols defined in discarded sections, so that
305 // Now that we have a complete set of output sections. This function
312 // If --compressed-debug-sections is specified, compress .debug_* sections.
313 // Do it right now because it changes the size of output sections.
322 // we know the size of the sections.
394 // With --gc-sections, the field is already filled.
426 // from live sections.
430 // Exclude local symbols pointing to .ARM.exidx sections.
432 // sections. After merging the .ARM.exidx sections, some of these symbols
473 // - demote symbols defined relative to /DISCARD/ discarded input sections so
505 // Iterate over all input sections and add a STT_SECTION symbol if any input
511 for (InputSectionBase *s : isd->sections) {
516 // Unlike other synthetic sections, mergeable output sections contain
517 // data copied from input sections, and there may be a relocation
552 // Non-allocatable or non-writable sections don't need RELRO because
554 // RELRO is for sections that are essentially read-only but need to
608 // Sections with some special names are put into RELRO. This is a
656 // Allocatable sections go first to reduce the total PT_LOAD size and
661 // Sort sections based on their access permission in the following
664 // Read-only sections come first such that they go in the PT_LOAD covering the
667 // The layout for writable sections is PT_LOAD(PT_GNU_RELRO(.data.rel.ro
676 // Among PROGBITS sections, place .lrodata further from .text.
692 // Put .note sections at the beginning so that they are likely to be
697 // Make PROGBITS sections (e.g .rodata .eh_frame) closer to .text to
698 // alleviate relocation overflow pressure. Large special sections such as
709 // TLS sections directly before the other RELRO sections.
727 // Within TLS sections, or within other RelRo sections, or within non-RelRo
728 // sections, place non-NOBITS sections first.
732 // Some architectures have additional ordering restrictions for sections
735 // PPC64 has a number of special SHT_PROGBITS+SHF_ALLOC+SHF_WRITE sections
749 // All sections with SHF_MIPS_GPREL flag should be grouped together
750 // because data in these sections is addressable with a gp relative address.
848 // that does not contain large sections.
911 // When placing orphan sections, we want to place them after symbol assignments
917 // We don't want to go over sections since findOrphanPos is the
918 // one in charge of deciding the order of the sections.
931 // We want to place orphan sections so that they share as much
937 // Place non-alloc orphan sections at the end. This matches how we assign file
938 // offsets to non-alloc sections.
1006 // alloc sections for example).
1015 // Adds random priorities to sections not already in the map.
1020 SmallVector<InputSectionBase *, 0> matched, sections = ctx.inputSections;
1021 matched.reserve(sections.size());
1024 for (InputSectionBase *sec : sections)
1029 // If --shuffle-sections <section-glob>=-1, reverse the section order. The
1030 // section order is stable even if the number of sections changes. This is
1039 for (InputSectionBase *&sec : sections)
1045 // sections.
1047 for (InputSectionBase *sec : sections) {
1056 // Use the rarely used option --call-graph-ordering-file to sort sections.
1076 // Build a map from sections to their priorities.
1111 // Sorts the sections in ISD according to the provided section order.
1121 for (InputSection *isec : isd->sections) {
1162 // The above is not necessary if total size of input sections in this "isd"
1163 // is small. Note that we assume all input sections are executable if the
1178 isd->sections.clear();
1180 isd->sections.push_back(isec);
1182 isd->sections.push_back(p.first);
1184 isd->sections.push_back(isec);
1195 // Sort input sections by priority using the list provided by
1196 // --symbol-ordering-file or --shuffle-sections=. This is a least significant
1197 // digit radix sort. The sections may be sorted stably again by a more
1216 // that sections having smaller relocation offsets are at beginning of .toc
1219 llvm::stable_sort(isd->sections,
1228 // sorting for special input sections. This also handles --symbol-ordering-file.
1239 llvm::TimeTraceScope timeScope("Sort sections");
1242 // relative order for SHF_LINK_ORDER sections.
1274 // Orphan sections are sections present in the input files which are
1277 // The sections in the linker script are already in the correct
1279 // sections.
1281 // The order of the sections in the script is arbitrary and may not agree with
1287 // have sections a, b and c with only b in a script and a less than c
1290 // to match, we can end up with sections a, b, c, d where b and c are in the
1299 // * Sort only the orphan sections. They are in the end right now.
1321 // Sort the orphan sections.
1339 // As an optimization, find all sections with the same sort rank
1353 // SHF_LINK_ORDER sections with non-zero sh_link are ordered before
1354 // non-SHF_LINK_ORDER sections and SHF_LINK_ORDER sections with zero sh_link.
1382 SmallVector<InputSection *, 0> sections;
1389 sections.clear();
1390 for (InputSection *&isec : isd->sections) {
1399 sections.push_back(isec);
1402 llvm::stable_sort(sections, compareByFilePosition);
1403 for (int i = 0, n = sections.size(); i != n; ++i)
1404 *scriptSections[i] = sections[i];
1412 llvm::TimeTraceScope timeScope("Finalize synthetic sections", sec->name);
1553 // If Input Sections have been shrunk (basic block sections) then
1554 // update symbol values and sizes associated with these sections. With basic
1555 // block sections, input sections can shrink when the jump instructions at
1596 // If basic block sections exist, there are opportunities to delete fall thru
1605 // For every output section that has executable input sections, this
1607 // 1. Deletes all direct jump instructions in input sections that
1614 ArrayRef<InputSection *> sections = getInputSections(*osec, storage);
1619 for (size_t i = 0, e = sections.size(); i != e; ++i) {
1620 InputSection *next = i + 1 < sections.size() ? sections[i + 1] : nullptr;
1621 InputSection &sec = *sections[i];
1638 // In order to allow users to manipulate linker-synthesized sections,
1639 // we had to add synthetic sections to the input section list early,
1648 // scanRelocations is called to remove synthetic sections that turn
1651 // All input synthetic sections that can be empty are placed after
1659 // Remove unused synthetic sections from ctx.inputSections;
1679 // Remove unused synthetic sections from the corresponding input section
1685 llvm::erase_if(isd->sections, [&](InputSection *isec) {
1701 // symbols for sections, so that the runtime can get the start and end
1931 // Add separate segments for MIPS-specific sections.
1952 // have the headers, we can find out which sections they point to.
1961 llvm::TimeTraceScope timeScope("Finalize synthetic sections");
2016 // sections to extend the ranges if jump targets are out of range. Such
2020 // because this is the earliest point where we know sizes of sections and
2024 // 2) Update the sections. We need to generate content that depends on the
2026 // android packed relocations sections content.
2038 llvm::TimeTraceScope timeScope("Finalize synthetic sections");
2048 // sections. Run after in.symTab is finalized as optimizeBasicBlockJumps
2055 // of finalizing other sections.
2067 // Ensure data sections are not mixed with executable sections when
2085 // symbols for a few sections. This function defines them.
2137 // Don't allocate VA space for TLS NOBITS sections. The PT_TLS PHDR is
2154 // Decide which program headers to create and which sections to include in each
2167 // Add the first PT_LOAD segment for regular output sections.
2186 // In the other partitions the headers are ordinary sections, so they don't
2195 // PT_GNU_RELRO includes all sections that should be marked as
2211 " sections");
2223 // Normally, sections in partitions other than the current partition are
2244 // In addition, NOBITS sections should only be placed at the end of a LOAD
2252 // When --no-rosegment is specified, RO and RX sections are compatible.
2334 // Create one PT_NOTE per a group of contiguous SHT_NOTE sections with the
2386 // sections will be extracted to a separate file. Align to the next
2443 // File offsets are not significant for .bss sections other than the first one
2454 // If two sections share the same PT_LOAD the file offset is calculated
2461 // Compute the minimum LMA of all non-empty non-NOBITS sections as minAddr.
2472 // Sections are laid out at LMA minus minAddr.
2485 // Assign file offsets to output sections.
2496 // Layout SHF_ALLOC sections before non-SHF_ALLOC sections. A non-SHF_ALLOC
2523 // Our logic assumes that sections have rising VA within the same segment.
2543 // file offsets and VAs to all sections.
2549 // .ARM.exidx sections may not be within a single .ARM.exidx
2594 // Check whether sections overlap for a specific address range (file offsets,
2596 static void checkOverlap(StringRef name, std::vector<SectionOffset> §ions,
2598 llvm::sort(sections, [=](const SectionOffset &a, const SectionOffset &b) {
2604 for (size_t i = 1, end = sections.size(); i < end; ++i) {
2605 SectionOffset a = sections[i - 1];
2606 SectionOffset b = sections[i];
2610 // If both sections are in OVERLAY we allow the overlapping of virtual
2623 // Check for overlapping sections and address overflows.
2625 // In this function we check that none of the output sections have overlapping
2626 // file offsets. For SHF_ALLOC sections we also check that the load address
2638 // section marked as SHT_NOBITS. These sections don't actually occupy space in
2640 // binary is specified only add SHF_ALLOC sections are added to the output
2641 // file so we skip any non-allocated sections in that case.
2656 // into account SHF_ALLOC sections since others will not be loaded.
2657 // Furthermore, we also need to skip SHF_TLS sections since these will be
2724 // e_shnum = 0, SHdrs[0].sh_size = number of sections.
2794 // overwritten by output sections.
2822 llvm::TimeTraceScope timeScope("Write sections");
2825 // In -r or --emit-relocs mode, write the relocation sections first as in
2879 // Compute a hash of all sections of the output file.