Lines Matching defs:sections

112   // Clear OutputSection::ptLoad for sections contained in removed
198 // combines the typical ELF GOT with the small data sections. It commonly
281 // In addition, demote symbols defined in discarded sections, so that
320 // Now that we have a complete set of output sections. This function
327 // If --compressed-debug-sections is specified, compress .debug_* sections.
328 // Do it right now because it changes the size of output sections.
337 // we know the size of the sections.
411 // With --gc-sections, the field is already filled.
443 // from live sections.
447 // Exclude local symbols pointing to .ARM.exidx sections.
449 // sections. After merging the .ARM.exidx sections, some of these symbols
490 // - demote symbols defined relative to /DISCARD/ discarded input sections so
523 // Iterate over all input sections and add a STT_SECTION symbol if any input
529 for (InputSectionBase *s : isd->sections) {
534 // Unlike other synthetic sections, mergeable output sections contain
535 // data copied from input sections, and there may be a relocation
570 // Non-allocatable or non-writable sections don't need RELRO because
572 // RELRO is for sections that are essentially read-only but need to
674 // Allocatable sections go first to reduce the total PT_LOAD size and
679 // Sort sections based on their access permission in the following
682 // Read-only sections come first such that they go in the PT_LOAD covering the
685 // The layout for writable sections is PT_LOAD(PT_GNU_RELRO(.data.rel.ro
694 // Among PROGBITS sections, place .lrodata further from .text.
710 // Put .note sections at the beginning so that they are likely to be
715 // Make PROGBITS sections (e.g .rodata .eh_frame) closer to .text to
716 // alleviate relocation overflow pressure. Large special sections such as
727 // TLS sections directly before the other RELRO sections.
745 // Within TLS sections, or within other RelRo sections, or within non-RelRo
746 // sections, place non-NOBITS sections first.
750 // Some architectures have additional ordering restrictions for sections
753 // PPC64 has a number of special SHT_PROGBITS+SHF_ALLOC+SHF_WRITE sections
767 // All sections with SHF_MIPS_GPREL flag should be grouped together
768 // because data in these sections is addressable with a gp relative address.
871 // that does not contain large sections.
934 // When placing orphan sections, we want to place them after symbol assignments
940 // We don't want to go over sections since findOrphanPos is the
941 // one in charge of deciding the order of the sections.
954 // We want to place orphan sections so that they share as much
960 // Place non-alloc orphan sections at the end. This matches how we assign file
961 // offsets to non-alloc sections.
1030 // alloc sections for example).
1039 // Adds random priorities to sections not already in the map.
1045 SmallVector<InputSectionBase *, 0> matched, sections = ctx.inputSections;
1046 matched.reserve(sections.size());
1049 for (InputSectionBase *sec : sections)
1054 // If --shuffle-sections <section-glob>=-1, reverse the section order. The
1055 // section order is stable even if the number of sections changes. This is
1064 for (InputSectionBase *&sec : sections)
1070 // sections.
1072 for (InputSectionBase *sec : sections) {
1103 // Build a map from sections to their priorities.
1139 // Sorts the sections in ISD according to the provided section order.
1149 for (InputSection *isec : isd->sections) {
1190 // The above is not necessary if total size of input sections in this "isd"
1191 // is small. Note that we assume all input sections are executable if the
1206 isd->sections.clear();
1208 isd->sections.push_back(isec);
1210 isd->sections.push_back(p.first);
1212 isd->sections.push_back(isec);
1223 // Sort input sections by priority using the list provided by
1224 // --symbol-ordering-file or --shuffle-sections=. This is a least significant
1225 // digit radix sort. The sections may be sorted stably again by a more
1244 // that sections having smaller relocation offsets are at beginning of .toc
1247 llvm::stable_sort(isd->sections,
1255 // Sort sections within each InputSectionDescription.
1259 // Assign non-negative priorities due to --shuffle-sections.
1267 llvm::TimeTraceScope timeScope("Sort sections");
1270 // relative order for SHF_LINK_ORDER sections.
1304 // Orphan sections are sections present in the input files which are
1307 // The sections in the linker script are already in the correct
1309 // sections.
1311 // The order of the sections in the script is arbitrary and may not agree with
1317 // have sections a, b and c with only b in a script and a less than c
1320 // to match, we can end up with sections a, b, c, d where b and c are in the
1329 // * Sort only the orphan sections. They are in the end right now.
1351 // Sort the orphan sections.
1371 // As an optimization, find all sections with the same sort rank
1385 // SHF_LINK_ORDER sections with non-zero sh_link are ordered before
1386 // non-SHF_LINK_ORDER sections and SHF_LINK_ORDER sections with zero sh_link.
1414 SmallVector<InputSection *, 0> sections;
1421 sections.clear();
1422 for (InputSection *&isec : isd->sections) {
1431 sections.push_back(isec);
1434 llvm::stable_sort(sections, compareByFilePosition);
1435 for (int i = 0, n = sections.size(); i != n; ++i)
1436 *scriptSections[i] = sections[i];
1444 llvm::TimeTraceScope timeScope("Finalize synthetic sections", sec->name);
1470 for (InputSection *isec : isd->sections) {
1477 isd->sections = std::move(tmp);
1623 // If Input Sections have been shrunk (basic block sections) then
1624 // update symbol values and sizes associated with these sections. With basic
1625 // block sections, input sections can shrink when the jump instructions at
1666 // If basic block sections exist, there are opportunities to delete fall thru
1675 // For every output section that has executable input sections, this
1677 // 1. Deletes all direct jump instructions in input sections that
1684 ArrayRef<InputSection *> sections = getInputSections(*osec, storage);
1689 for (size_t i = 0, e = sections.size(); i != e; ++i) {
1690 InputSection *next = i + 1 < sections.size() ? sections[i + 1] : nullptr;
1691 InputSection &sec = *sections[i];
1708 // In order to allow users to manipulate linker-synthesized sections,
1709 // we had to add synthetic sections to the input section list early,
1718 // scanRelocations is called to remove synthetic sections that turn
1721 // All input synthetic sections that can be empty are placed after
1729 // Remove unused synthetic sections from ctx.inputSections;
1748 // Remove unused synthetic sections from the corresponding input section
1754 llvm::erase_if(isd->sections, [&](InputSection *isec) {
1770 // symbols for sections, so that the runtime can get the start and end
1967 // sections.
2015 // Add separate segments for MIPS-specific sections.
2037 // have the headers, we can find out which sections they point to.
2046 llvm::TimeTraceScope timeScope("Finalize synthetic sections");
2101 // sections to extend the ranges if jump targets are out of range. Such
2105 // because this is the earliest point where we know sizes of sections and
2109 // 2) Update the sections. We need to generate content that depends on the
2111 // android packed relocations sections content.
2123 llvm::TimeTraceScope timeScope("Finalize synthetic sections");
2133 // sections. Run after ctx.in.symTab is finalized as optimizeBasicBlockJumps
2140 // of finalizing other sections.
2152 // Ensure data sections are not mixed with executable sections when
2170 // symbols for a few sections. This function defines them.
2223 // Don't allocate VA space for TLS NOBITS sections. The PT_TLS PHDR is
2240 // Decide which program headers to create and which sections to include in each
2254 // Add the first PT_LOAD segment for regular output sections.
2273 // In the other partitions the headers are ordinary sections, so they don't
2282 // PT_GNU_RELRO includes all sections that should be marked as
2298 << " is not contiguous with other relro" << " sections";
2310 // Normally, sections in partitions other than the current partition are
2331 // In addition, NOBITS sections should only be placed at the end of a LOAD
2339 // When --no-rosegment is specified, RO and RX sections are compatible.
2426 // Create one PT_NOTE per a group of contiguous SHT_NOTE sections with the
2478 // sections will be extracted to a separate file. Align to the next
2535 // File offsets are not significant for .bss sections other than the first one
2545 // If two sections share the same PT_LOAD the file offset is calculated
2552 // Compute the minimum LMA of all non-empty non-NOBITS sections as minAddr.
2576 // Assign file offsets to output sections.
2587 // Layout SHF_ALLOC sections before non-SHF_ALLOC sections. A non-SHF_ALLOC
2615 // Our logic assumes that sections have rising VA within the same segment.
2636 // file offsets and VAs to all sections.
2642 // .ARM.exidx sections may not be within a single .ARM.exidx
2687 // Check whether sections overlap for a specific address range (file offsets,
2690 std::vector<SectionOffset> &sections,
2692 llvm::sort(sections, [=](const SectionOffset &a, const SectionOffset &b) {
2698 for (size_t i = 1, end = sections.size(); i < end; ++i) {
2699 SectionOffset a = sections[i - 1];
2700 SectionOffset b = sections[i];
2704 // If both sections are in OVERLAY we allow the overlapping of virtual
2717 // Check for overlapping sections and address overflows.
2719 // In this function we check that none of the output sections have overlapping
2720 // file offsets. For SHF_ALLOC sections we also check that the load address
2733 // section marked as SHT_NOBITS. These sections don't actually occupy space in
2735 // binary is specified only add SHF_ALLOC sections are added to the output
2736 // file so we skip any non-allocated sections in that case.
2751 // into account SHF_ALLOC sections since others will not be loaded.
2752 // Furthermore, we also need to skip SHF_TLS sections since these will be
2823 // e_shnum = 0, SHdrs[0].sh_size = number of sections.
2894 // overwritten by output sections.
2922 llvm::TimeTraceScope timeScope("Write sections");
2925 // In -r or --emit-relocs mode, write the relocation sections first as in
2979 // Compute a hash of all sections of the output file.