Lines Matching +defs:add +defs:to +defs:list

53   // want to emit .rela.text.foo as .rela.text.bar for consistency (this is not
75 // linker scripts. It should go to .bss section.
87 // We provide an option -z keep-text-section-prefix to group such sections
194 recordError(loc + ": unable to move location counter (0x" +
195 Twine::utohexstr(dot) + ") backward to 0x" +
200 // Update to location counter means update to section size.
217 // Called by processSymbolAssignments() to assign definitions to
233 // However, if an expression is `x = .`, there's no way to know its
236 // We want to set symbol values early if we can. This allows us to
237 // use symbols as variables in linker scripts. Doing so allows us to
280 // Collect section/value pairs of linker-script-defined symbols. This is used to
318 // specified output section to the designated place.
341 auto *to = dyn_cast<OutputDesc>(subCmd);
342 return to != nullptr && to->osec.name == cmd.where;
345 ErrAlways(ctx) << "unable to insert " << cmd.names[0]
370 // we can't say for sure if it is going to be included or not.
372 // need symbols from that sections to be declared early.
384 // to set the final value for a given symbol assignment.
462 // before sections with smaller alignments in order to reduce the
498 // 4. If no SORT command is given, sort according to --sort-section.
552 // For --emit-relocs we have to ignore entries like
556 // want to support scripts that do custom layout for them.
561 // Check the name early to improve performance in the common case.
580 // generate a spill in a subsequent match. Those behaviors belong to
634 << "' cannot spill from/to /DISCARD/";
645 // cause sections to match an InputSectionDescription in more than one
653 // Append the spill input section to the list for the input section,
715 // Any input section assigned to it is discarded.
730 // way to "make it as if it wasn't present" is to make it empty.
739 // is given, input sections are aligned to that value, whether the
783 // necessarily an error due to --enable-non-contiguous-regions. Such
816 << "' cannot spill from/to INSERT section '" << os->name
823 // sectionCommands, append it to the end. The section will be inserted by
830 // must have been assigned to an output section.
855 // current state through to a lambda function created by the script parser.
895 // However, for the -r option, we want to pass through all section groups
927 // However, it is clear that at least some flags have to be ignored for
928 // section merging. At the very least SHF_GROUP and SHF_COMPRESSED have to be
950 // expressions like *(.foo*) can refer to multiple input sections with
956 // and a mapping of .foo1 and .bar1 to one section and .foo2 and .bar2 to
957 // another. The problem is that there is no way to layout those output
971 // end up being linked to the same output section. The casts are fine
997 auto add = [&](InputSectionBase *s) {
1016 // to be created before we create relocation output section, so we want
1017 // to create target sections first. We do not want priority handling
1026 // sections because we need to know the parent's output section before we
1034 add(relIS);
1035 add(isec);
1039 add(depSec);
1047 // When SECTIONS command is present we just add all orphans to the end.
1061 // automatically. The section is not supposed to be specified by scripts.
1084 ErrAlways(ctx) << "no address assigned to the veneers output section "
1088 // This function searches for a memory region to place the given output
1089 // section in. If found, a pointer to the appropriate memory region is
1091 // The second member of the pair is a hint that should be passed to the
1110 // then try to find that region first.
1120 // belong to some memory region. Otherwise, we don't need to do
1149 // Assign addresses to an output section and offsets to its input sections and
1178 // region, we need to expand the current region to account for the space
1199 // reuse previous lmaOffset; otherwise, reset lmaOffset to 0. This emulates
1213 // Propagate state->lmaOffset to the first "non-header" section.
1219 // thunks and want to start over calculation each time.
1222 // We visited SectionsCommands from processSectionCommands to
1223 // layout sections. Now, we visit SectionsCommands again to fix
1226 // This handles the assignments to symbol or to the dot.
1263 // If .relro_padding is present, round up the end to a common-page-size
1264 // boundary to protect the last page.
1284 // We do not want to remove OutputSections with expressions that reference
1285 // symbols even if the OutputSection is empty. We want to ensure that the
1292 // to maintain the integrity of the other Expression.
1313 // headers to sections that are allocated.
1323 // corresponding output section. The issue is what to do with linker script
1324 // like ".foo : { symbol = 42; }". One option would be to convert it to
1326 // description. That seems to be what bfd does for this simple case. The
1330 // Given that we want to create the section, we have to worry what impact
1335 // that would need to change:
1339 // The other option is to pick flags that minimize the impact the section
1341 // the previous sections. We copy just SHF_ALLOC and SHF_WRITE to keep the
1343 // lead to executable writeable section.
1361 // flags to be inherited by subsequent output sections. (sec may contain
1366 // We do not want to keep any special flags for output section
1375 // specified program headers (if exist) and propagate them to subsequent
1401 // It is common practice to use very generic linker scripts. So for any
1411 // Try and find an appropriate memory region to assign offsets in.
1428 // and we haven't previously assigned any section to segment,
1429 // then we simply assign section to the very first load segment.
1440 // Walk the commands and propagate the program headers to commands that don't
1447 // When the SECTIONS command is used, try to find an address for the file and
1448 // program headers output sections, which can be added to the first PT_LOAD
1475 // headers, only allocate program headers if that would not add a page.
1485 // Error if we were explicitly asked to allocate headers.
1504 // sub-commands. Doing that allows us to use final VA values, so here
1511 // With a linker script, assignment of addresses to headers is covered by
1515 // Assign addresses to headers right now.
1553 // Spill input sections in reverse order of address assignment to (potentially)
1588 // Find the next potential spill location and remove it from the list.
1592 PotentialSpillList &list = it->second;
1593 PotentialSpillSection *spill = list.head;
1595 list.head = spill->next;
1600 // its properties to match the new location. Note that the alignment of
1601 // the spill section may have diverged from the original due to e.g. a
1602 // SUBALIGN. Correct assignment requires the spill's alignment to be
1616 // the spill's success or lead to yet more spilling.
1622 // Remove any spilled input sections to complete their move.
1643 for (const auto &[_, list] : potentialSpillLists)
1644 for (PotentialSpillSection *s = list.head; s; s = s->next)
1666 phdr->add(ctx.out.elfHeader.get());
1668 phdr->add(ctx.out.programHeaders.get());
1677 // Add output sections to program headers.
1681 ret[id]->add(sec);
1692 // no PT_INTERP is there, there's no place to emit an
1707 ErrAlways(ctx) << loc << ": unable to get location counter value";
1715 // behavior in relocation processing. Any operation will reset st_type to
1809 // are undefined symbols for them, so we add these to trigger that logic.
1818 // Keeps track of references from which PROVIDE symbols have been added to the
1842 // symbol must be the same for each call. We use unusedProvideSyms to not