Lines Matching full:sections
317 Because of this, the related sections can shrink in the stripped
386 /* Update relocation sections using the symbol table. */
525 /* Adjust all the relocation sections in the file. */
544 sections, even the unallocated ones. To match it as closely as
545 possible, add in section symbols for the added sections. */
692 /* Sort all non-allocated sections last. */
869 sections_match (const struct section *sections, size_t i,
872 return (sections[i].shdr.sh_flags == shdr->sh_flags
873 && (sections[i].shdr.sh_size == shdr->sh_size
874 || (sections[i].shdr.sh_size < shdr->sh_size
875 && section_can_shrink (§ions[i].shdr)))
876 && !strcmp (sections[i].name, name));
879 /* Locate a matching allocated section in SECTIONS. */
882 struct section sections[], size_t nalloc)
889 if (addr < sections[i].shdr.sh_addr)
891 else if (addr > sections[i].shdr.sh_addr)
895 /* We've found allocated sections with this address.
897 while (i > 0 && sections[i - 1].shdr.sh_addr == addr)
899 for (; i < nalloc && sections[i].shdr.sh_addr == addr;
901 if (sections_match (sections, i, shdr, name))
902 return §ions[i];
918 /* Fix things up when prelink has moved some allocated sections around
920 This fills in SECTIONS[0..NALLOC-1].outscn or exits.
921 If there was a .bss section that was split into two sections
927 struct section *sections,
932 sections[i].outscn = NULL;
937 const struct section *sec = §ions[i];
947 /* Find the original allocated sections before prelinking. */
1080 the sections to give error messages about. */
1082 if (sections[i].outscn == scn)
1090 /* Now we have lined up output sections for each of the original sections
1091 before prelinking. Translate those to the prelinked sections.
1103 struct section *sec = §ions[j];
1131 && (split_bss = sec) > sections)))
1156 struct section *sections, size_t stripped_shnum,
1164 for (struct section *sec = sections;
1165 sec < §ions[stripped_shnum - 1];
1178 /* Add names of sections we aren't touching. */
1200 /* Update the sh_name fields of sections we aren't modifying later. */
1217 /* Fill in any SHT_NOBITS sections in UNSTRIPPED by
1240 struct section sections[stripped_shnum - 1];
1245 GElf_Shdr *shdr = gelf_getshdr (scn, §ions[i].shdr);
1247 sections[i].name = elf_strptr (stripped, stripped_shstrndx,
1249 if (sections[i].name == NULL)
1252 sections[i].scn = scn;
1253 sections[i].outscn = NULL;
1254 sections[i].strent = NULL;
1259 /* Sort the sections, allocated by address and others after. */
1260 qsort (sections, stripped_shnum - 1, sizeof sections[0],
1264 while (nalloc > 0 && !(sections[nalloc - 1].shdr.sh_flags & SHF_ALLOC))
1267 if (sections[nalloc].shdr.sh_type == SHT_SYMTAB)
1268 stripped_symtab = §ions[nalloc];
1271 /* Locate a matching unallocated section in SECTIONS. */
1279 struct section *sec = §ions[i];
1328 sec = find_alloc_section (shdr, bias, name, sections, nalloc);
1338 /* The sh_addr of allocated sections does not help us,
1340 if (likely (sections_match (sections, alloc_avail, shdr, name)))
1341 sec = §ions[alloc_avail++];
1344 if (sections_match (sections, i, shdr, name))
1346 sec = §ions[i];
1364 .comment sections, so let those pass. */
1390 data, bias, sections,
1399 for (struct section *sec = sections;
1400 sec < §ions[stripped_shnum - 1];
1456 /* Cache the mapping of original section indices to output sections. */
1460 /* We added some sections, so we need a new shstrtab. */
1463 sections, stripped_shnum,
1473 /* Now update the output sections and copy in their data. */
1475 for (const struct section *sec = sections;
1476 sec < §ions[stripped_shnum - 1];
1485 sections will have been set nonzero by relocation. This
1513 /* Preserve the file layout of the allocated sections. */
1728 for (const struct section *sec = sections;
1729 sec < §ions[stripped_shnum - 1];
1760 the added sections. We do manual layout even for ET_REL just
2043 because the DWARF sections have been relocated. */
2055 /* Relocation is what we want! This ensures that all sections that can