Lines Matching full:sections

83   // When no SECTIONS is specified, emulate GNU ld's internal linker scripts
84 // by grouping sections with certain prefixes.
86 // GNU ld places text sections with prefix ".text.hot.", ".text.unknown.",
88 // We provide an option -z keep-text-section-prefix to group such sections
89 // into separate output sections. This is more flexible. See also
96 // input sections. For example, with -fsplit-machine-functions, placing the
313 // adjustOutputSections(). We do not handle such output sections.
354 // Skip such sections for now. Improve the checks if we ever
355 // need symbols from that sections to be declared early.
424 static bool matchConstraints(ArrayRef<InputSectionBase *> sections,
430 sections, [](InputSectionBase *sec) { return sec->flags & SHF_WRITE; });
439 // ">" is not a mistake. Sections with larger alignments are placed
440 // before sections with smaller alignments in order to reduce the
466 // Sort sections as instructed by SORT-family commands and --sort-section
490 // Compute and remember which sections the InputSectionDescription matches.
493 ArrayRef<InputSectionBase *> sections,
502 ret[i] = sections[indexes[i]];
508 // Collects all sections that satisfy constraints of Cmd.
513 for (size_t i = 0, e = sections.size(); i != e; ++i) {
516 InputSectionBase *sec = sections[i];
523 // We do not ignore SHT_REL[A] linker-synthesized sections here because
548 // Skip if the section's first match was /DISCARD/; such sections are
569 // Matched sections are ordered by radix sort with the keys being (SORT*,
573 // Matched sections between the previous SORT* and this SORT* are sorted by
576 // Matched sections by this SORT* pattern are sorted using all 3 keys.
584 // Matched sections after the last SORT* are sorted by (--sort-alignment,
588 // The flag --enable-non-contiguous-regions may cause sections to match an
591 // spill sections.
653 // Create output sections described by SECTIONS commands.
670 // sections satisfy a given constraint. If not, a directive is handled
683 // is given, input sections are aligned to that value, whether the
692 // does. Partitions cannot be used with the SECTIONS command, so this is
775 // Sections with SHT_GROUP or SHF_GROUP attributes reach here only when the -r
786 // relocation sections .rela.foo and .rela.bar for example. Most tools do
787 // not allow multiple REL[A] sections for output section. Hence we
788 // should combine these relocation sections into single output.
789 // We skip synthetic sections because it can be .rela.dyn/.rela.plt or any
790 // other REL[A] sections created by linker itself.
807 // In the first phase, input sections that match in name, type and
808 // attribute flags should be concatenated into single sections.
813 // ignored. We should not have two output .text sections just because one was
819 // Merging sections with different flags is expected by some users. One
834 // expressions like *(.foo*) can refer to multiple input sections with
835 // different flags. We cannot put them in different output sections or we
842 // sections such that the .foo sections are the only thing between the start
845 // Given the above issues, we instead merge sections by name and error on
853 // Merging two SHF_LINK_ORDER sections with different sh_link fields will
876 // Add sections that didn't match any sections command.
901 // to create target sections first. We do not want priority handling
902 // for synthetic sections because them are special.
909 // In -r links, SHF_LINK_ORDER sections are added while adding their parent
910 // sections because we need to know the parent's output section before we
928 // If no SECTIONS command was given, we should insert sections commands
931 // When SECTIONS command is present we just add all orphans to the end.
939 llvm::TimeTraceScope timeScope("Diagnose orphan sections");
978 // Non-allocatable sections are not part of the process image.
1000 // If at least one memory region is defined, all sections must
1029 // Assign addresses to an output section and offsets to its input sections and
1041 // Non-SHF_ALLOC sections have zero addresses.
1044 // Allow consecutive SHF_TLS SHT_NOBITS output sections. The address range
1078 // region is the default, and the two sections are in the same memory region,
1103 // layout sections. Now, we visit SectionsCommands again to fix
1126 auto &sections = cast<InputSectionDescription>(cmd)->sections;
1127 for (InputSection *isec : sections) {
1148 // Non-SHF_ALLOC sections do not affect the addresses of other OutputSections
1153 // NOBITS TLS sections are similar. Additionally save the end address.
1178 // Don't create empty output sections just for unreferenced PROVIDE
1193 // headers to sections that are allocated.
1221 // the previous sections. We copy just SHF_ALLOC and SHF_WRITE to keep the
1241 // flags to be inherited by subsequent output sections. (sec may contain
1254 // The code below may remove empty output sections. We should save the
1256 // sections which do not specify program headers.
1258 // SECTIONS { .empty : { *(.empty) } :rw
1260 // Note: at this point the order of output sections has not been finalized,
1281 // given run some of the output sections in the script will be empty.
1282 // We could create corresponding empty output sections, but that would
1284 // We instead remove trivially empty sections. The bfd linker seems even
1310 // SECTIONS { .aaa : { *(.aaa) } }
1326 // If there is no SECTIONS or if the linkerscript is explicit about program
1334 // When the SECTIONS command is used, try to find an address for the file and
1335 // program headers output sections, which can be added to the first PT_LOAD
1339 // enough space for these sections, we'll remove them from the PT_LOAD segment,
1386 // Here we assign addresses as instructed by linker script SECTIONS
1434 // Spill input sections in reverse order of address assignment to (potentially)
1452 // Input sections that have replaced a potential spill and should be removed
1464 for (InputSection *isec : reverse(isd->sections)) {
1486 *llvm::find(spill->isd->sections, spill) = isec;
1503 // Remove any spilled input sections to complete their move.
1506 llvm::erase_if(isd->sections, [&](InputSection *isec) {
1516 // Erase any potential spill sections that were not used.
1529 llvm::erase_if(isd->sections, [](InputSection *s) {
1541 // real output sections and cannot be added in the following loop.
1557 // Add output sections to program headers.
1708 // Prevent the symbol from being discarded by --gc-sections.