Lines Matching refs:sec
1097 const struct section *sec = §ions[i]; in find_alloc_sections_prelink() local
1098 if (sec->shdr.sh_type == SHT_PROGBITS in find_alloc_sections_prelink()
1099 && !(sec->shdr.sh_flags & SHF_ALLOC) in find_alloc_sections_prelink()
1100 && !strcmp (sec->name, ".gnu.prelink_undo")) in find_alloc_sections_prelink()
1102 undo = sec->scn; in find_alloc_sections_prelink()
1180 struct section *sec = &undo_sections[undo_nalloc]; in find_alloc_sections_prelink() local
1185 #define COPY(field) sec->shdr.field = (*s32)[i].field in find_alloc_sections_prelink()
1199 sec->shdr = (*s64)[i]; in find_alloc_sections_prelink()
1200 if (sec->shdr.sh_flags & SHF_ALLOC) in find_alloc_sections_prelink()
1202 sec->shdr.sh_addr += bias; in find_alloc_sections_prelink()
1203 sec->name = get_section_name (i + 1, &sec->shdr, main_shstrtab); in find_alloc_sections_prelink()
1204 sec->scn = elf_getscn (main, i + 1); /* Really just for ndx. */ in find_alloc_sections_prelink()
1205 sec->outscn = NULL; in find_alloc_sections_prelink()
1206 sec->strent = NULL; in find_alloc_sections_prelink()
1207 sec->sig = get_group_sig (main, &sec->shdr); in find_alloc_sections_prelink()
1232 struct section *sec = find_alloc_section (shdr, 0, name, in find_alloc_sections_prelink() local
1235 if (sec != NULL) in find_alloc_sections_prelink()
1237 sec->outscn = scn; in find_alloc_sections_prelink()
1266 struct section *sec = §ions[j]; in find_alloc_sections_prelink() local
1268 (2 * sec->shdr.field == 3 * undo_sec->shdr.field) in find_alloc_sections_prelink()
1269 if (sec->outscn == NULL in find_alloc_sections_prelink()
1270 && sec->shdr.sh_name == undo_sec->shdr.sh_name in find_alloc_sections_prelink()
1271 && sec->shdr.sh_flags == undo_sec->shdr.sh_flags in find_alloc_sections_prelink()
1272 && sec->shdr.sh_addralign == undo_sec->shdr.sh_addralign in find_alloc_sections_prelink()
1273 && (((sec->shdr.sh_type == undo_sec->shdr.sh_type in find_alloc_sections_prelink()
1274 && sec->shdr.sh_entsize == undo_sec->shdr.sh_entsize in find_alloc_sections_prelink()
1275 && (sec->shdr.sh_size == undo_sec->shdr.sh_size in find_alloc_sections_prelink()
1276 || (sec->shdr.sh_size > undo_sec->shdr.sh_size in find_alloc_sections_prelink()
1278 && !strcmp (sec->name, ".dynstr")))) in find_alloc_sections_prelink()
1279 || (sec->shdr.sh_size == undo_sec->shdr.sh_size in find_alloc_sections_prelink()
1280 && ((sec->shdr.sh_entsize == undo_sec->shdr.sh_entsize in find_alloc_sections_prelink()
1283 && !strcmp (sec->name, ".plt"))) in find_alloc_sections_prelink()
1284 || (sec->shdr.sh_type == SHT_RELA in find_alloc_sections_prelink()
1287 || (sec->shdr.sh_entsize == undo_sec->shdr.sh_entsize in find_alloc_sections_prelink()
1288 && (sec->shdr.sh_type == undo_sec->shdr.sh_type in find_alloc_sections_prelink()
1289 || (sec->shdr.sh_type == SHT_PROGBITS in find_alloc_sections_prelink()
1291 && sec->shdr.sh_size <= undo_sec->shdr.sh_size in find_alloc_sections_prelink()
1292 && (!strcmp (sec->name, ".bss") in find_alloc_sections_prelink()
1293 || !strcmp (sec->name, ".sbss")) in find_alloc_sections_prelink()
1294 && (sec->shdr.sh_size == undo_sec->shdr.sh_size in find_alloc_sections_prelink()
1295 || (split_bss = sec) > sections)))) in find_alloc_sections_prelink()
1297 sec->outscn = undo_sec->outscn; in find_alloc_sections_prelink()
1328 for (struct section *sec = sections; in new_shstrtab() local
1329 sec < §ions[stripped_shnum - 1]; in new_shstrtab()
1330 ++sec) in new_shstrtab()
1331 if (sec->outscn != NULL) in new_shstrtab()
1333 if (sec->strent == NULL) in new_shstrtab()
1335 sec->strent = dwelf_strtab_add (strtab, sec->name); in new_shstrtab()
1336 ELF_CHECK (sec->strent != NULL, in new_shstrtab()
1339 unstripped_strent[elf_ndxscn (sec->outscn) - 1] = sec->strent; in new_shstrtab()
1485 struct section *sec = NULL; in copy_elided_sections() local
1491 sec = find_alloc_section (shdr, bias, name, sections, nalloc); in copy_elided_sections()
1492 if (sec == NULL) in copy_elided_sections()
1504 sec = §ions[alloc_avail++]; in copy_elided_sections()
1509 sec = §ions[i]; in copy_elided_sections()
1532 sec = section; in copy_elided_sections()
1537 if (sec == NULL) in copy_elided_sections()
1552 if (sec == NULL) in copy_elided_sections()
1556 sec->outscn = scn; in copy_elided_sections()
1581 for (struct section *sec = sections; in copy_elided_sections() local
1582 sec < §ions[ndx_sec_num]; in copy_elided_sections()
1583 ++sec) in copy_elided_sections()
1585 size_t secndx = elf_ndxscn (sec->scn); in copy_elided_sections()
1587 if (sec->outscn == NULL) in copy_elided_sections()
1598 if (unstripped_symtab != NULL && sec == stripped_symtab) in copy_elided_sections()
1614 if (!(sec->shdr.sh_flags & SHF_ALLOC) in copy_elided_sections()
1615 && !strcmp (sec->name, ".gnu_debuglink")) in copy_elided_sections()
1623 sec->outscn = elf_newscn (unstripped); in copy_elided_sections()
1624 Elf_Data *newdata = elf_newdata (sec->outscn); in copy_elided_sections()
1625 ELF_CHECK (newdata != NULL && gelf_update_shdr (sec->outscn, in copy_elided_sections()
1626 &sec->shdr), in copy_elided_sections()
1631 sec->strent = dwelf_strtab_add (strtab, sec->name); in copy_elided_sections()
1632 ELF_CHECK (sec->strent != NULL, in copy_elided_sections()
1637 ndx_section[secndx - 1] = elf_ndxscn (sec->outscn); in copy_elided_sections()
1655 for (const struct section *sec = sections; in copy_elided_sections() local
1656 sec < §ions[stripped_shnum - 1]; in copy_elided_sections()
1657 ++sec) in copy_elided_sections()
1658 if (sec->outscn != NULL) in copy_elided_sections()
1661 GElf_Shdr *shdr = gelf_getshdr (sec->outscn, &shdr_mem); in copy_elided_sections()
1672 shdr_mem.sh_addr = sec->shdr.sh_addr; in copy_elided_sections()
1674 shdr_mem.sh_type = sec->shdr.sh_type; in copy_elided_sections()
1675 shdr_mem.sh_size = sec->shdr.sh_size; in copy_elided_sections()
1676 shdr_mem.sh_info = sec->shdr.sh_info; in copy_elided_sections()
1677 shdr_mem.sh_link = sec->shdr.sh_link; in copy_elided_sections()
1681 if ((sec->shdr.sh_type == SHT_REL || sec->shdr.sh_type == SHT_RELA) in copy_elided_sections()
1682 && sec->shdr.sh_flags != shdr_mem.sh_flags in copy_elided_sections()
1683 && (sec->shdr.sh_flags & SHF_INFO_LINK) != 0) in copy_elided_sections()
1686 if (sec->shdr.sh_link != SHN_UNDEF) in copy_elided_sections()
1688 if (sec->shdr.sh_link > ndx_sec_num) in copy_elided_sections()
1691 elf_ndxscn (sec->scn), sec->shdr.sh_link); in copy_elided_sections()
1692 shdr_mem.sh_link = ndx_section[sec->shdr.sh_link - 1]; in copy_elided_sections()
1694 if (SH_INFO_LINK_P (&sec->shdr) && sec->shdr.sh_info != 0) in copy_elided_sections()
1696 if (sec->shdr.sh_info > ndx_sec_num) in copy_elided_sections()
1699 elf_ndxscn (sec->scn), sec->shdr.sh_info); in copy_elided_sections()
1700 shdr_mem.sh_info = ndx_section[sec->shdr.sh_info - 1]; in copy_elided_sections()
1704 shdr_mem.sh_name = dwelf_strent_off (sec->strent); in copy_elided_sections()
1706 Elf_Data *indata = elf_getdata (sec->scn, NULL); in copy_elided_sections()
1708 Elf_Data *outdata = elf_getdata (sec->outscn, NULL); in copy_elided_sections()
1716 if (max_off > 0 && sec->shdr.sh_offset > (Elf64_Off) max_off) in copy_elided_sections()
1719 elf_ndxscn (sec->scn), sec->shdr.sh_offset); in copy_elided_sections()
1721 shdr_mem.sh_offset = sec->shdr.sh_offset; in copy_elided_sections()
1722 placed[elf_ndxscn (sec->outscn) - 1] = true; in copy_elided_sections()
1731 update_shdr (sec->outscn, &shdr_mem); in copy_elided_sections()
1775 stripped_symtab = sec; in copy_elided_sections()
1777 stripped_dynsym = sec; in copy_elided_sections()
1918 Elf_Scn *sec = elf_getscn (unstripped, i + 1); in copy_elided_sections() local
1920 GElf_Shdr *hdr = gelf_getshdr (sec, &mem); in copy_elided_sections()
1945 Elf_Scn *sec = elf_getscn (unstripped, i + 1); in copy_elided_sections() local
1947 GElf_Shdr *hdr = gelf_getshdr (sec, &mem); in copy_elided_sections()
1949 update_shdr (sec, hdr); in copy_elided_sections()
1999 for (const struct section *sec = sections; in copy_elided_sections() local
2000 sec < §ions[stripped_shnum - 1]; in copy_elided_sections()
2001 ++sec) in copy_elided_sections()
2002 if (sec->outscn != NULL && sec->shdr.sh_link == old_sh_link) in copy_elided_sections()
2003 adjust_relocs (sec->outscn, sec->scn, &sec->shdr, in copy_elided_sections()