Lines Matching defs:sections

351    Because of this, the related sections can shrink in the stripped
426 /* Update relocation sections using the symbol table. */
566 /* Adjust all the relocation sections in the file. */
585 sections, even the unallocated ones. To match it as closely as
586 possible, add in section symbols for the added sections. */
732 /* Sort all non-allocated sections last. */
907 /* Return true if the flags of the sections match, ignoring the SHF_INFO_LINK
924 sections_match (const struct section *sections, size_t i,
927 return (sections_flags_match (sections[i].shdr.sh_flags, shdr->sh_flags,
928 sections[i].shdr.sh_type)
929 && (sections[i].shdr.sh_size == shdr->sh_size
930 || (sections[i].shdr.sh_size < shdr->sh_size
931 && section_can_shrink (&sections[i].shdr)))
932 && !strcmp (sections[i].name, name));
938 struct section sections[], size_t nalloc)
945 if (addr < sections[i].shdr.sh_addr)
947 else if (addr > sections[i].shdr.sh_addr)
951 /* We've found allocated sections with this address.
953 while (i > 0 && sections[i - 1].shdr.sh_addr == addr)
955 for (; i < nalloc && sections[i].shdr.sh_addr == addr;
957 if (sections_match (sections, i, shdr, name))
958 return &sections[i];
974 /* Fix things up when prelink has moved some allocated sections around
977 If there was a .bss section that was split into two sections
983 struct section *sections,
989 const struct section *sec = &sections[i];
999 /* Find the original allocated sections before prelinking. */
1006 sections[i].outscn = NULL;
1141 the sections to give error messages about. */
1143 if (sections[i].outscn == scn)
1151 /* Now we have lined up output sections for each of the original sections
1152 before prelinking. Translate those to the prelinked sections.
1164 struct section *sec = &sections[j];
1193 || (split_bss = sec) > sections))))
1218 struct section *sections, size_t stripped_shnum,
1226 for (struct section *sec = sections;
1227 sec < &sections[stripped_shnum - 1];
1240 /* Add names of sections we aren't touching. */
1262 /* Update the sh_name fields of sections we aren't modifying later. */
1278 /* Fill in any SHT_NOBITS sections in UNSTRIPPED by
1302 more sections in stripped file than debug file -- arguments reversed?"));
1305 struct section sections[stripped_shnum - 1];
1310 GElf_Shdr *shdr = gelf_getshdr (scn, &sections[i].shdr);
1312 sections[i].name = elf_strptr (stripped, stripped_shstrndx,
1314 if (sections[i].name == NULL)
1317 sections[i].scn = scn;
1318 sections[i].outscn = NULL;
1319 sections[i].strent = NULL;
1324 /* Sort the sections, allocated by address and others after. */
1325 qsort (sections, stripped_shnum - 1, sizeof sections[0],
1329 while (nalloc > 0 && !(sections[nalloc - 1].shdr.sh_flags & SHF_ALLOC))
1332 if (sections[nalloc].shdr.sh_type == SHT_SYMTAB)
1333 stripped_symtab = &sections[nalloc];
1344 struct section *sec = &sections[i];
1391 sec = find_alloc_section (shdr, bias, name, sections, nalloc);
1401 /* The sh_addr of allocated sections does not help us,
1403 if (likely (sections_match (sections, alloc_avail, shdr, name)))
1404 sec = &sections[alloc_avail++];
1407 if (sections_match (sections, i, shdr, name))
1409 sec = &sections[i];
1427 .comment sections, so let those pass. */
1453 data, bias, sections,
1462 for (struct section *sec = sections;
1463 sec < &sections[stripped_shnum - 1];
1519 /* Cache the mapping of original section indices to output sections. */
1523 /* We added some sections, so we need a new shstrtab. */
1526 sections, stripped_shnum,
1536 /* Now update the output sections and copy in their data. */
1538 for (const struct section *sec = sections;
1539 sec < &sections[stripped_shnum - 1];
1548 sections will have been set nonzero by relocation. This
1584 /* Preserve the file layout of the allocated sections. */
1841 for (const struct section *sec = sections;
1842 sec < &sections[stripped_shnum - 1];
1873 the added sections. We do manual layout even for ET_REL just
1895 /* We must make sure we have read in the data of all sections
2189 because the DWARF sections have been relocated. */
2201 /* Relocation is what we want! This ensures that all sections that can