Lines Matching refs:shdr
409 GElf_Shdr shdr; in handle_elf() member
604 if (gelf_getshdr (scn, &shdr_info[cnt].shdr) == NULL) in handle_elf()
609 shdr_info[cnt].shdr.sh_name); in handle_elf()
621 shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link; in handle_elf()
629 || (shdr_info[cnt].shdr.sh_flags & SHF_ALLOC) == 0) in handle_elf()
630 shdr_info[cnt].shdr.sh_offset = 0; in handle_elf()
634 if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX)) in handle_elf()
636 elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0); in handle_elf()
637 shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt; in handle_elf()
639 else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP)) in handle_elf()
667 else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym)) in handle_elf()
669 elf_assert (shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0); in handle_elf()
670 shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt; in handle_elf()
675 if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0) in handle_elf()
683 shdr_info[cnt].shdr.sh_flags &= ~SHF_GROUP; in handle_elf()
703 if (remove_shdrs ? !(shdr_info[cnt].shdr.sh_flags & SHF_ALLOC) in handle_elf()
704 : ebl_section_strip_p (ebl, ehdr, &shdr_info[cnt].shdr, in handle_elf()
753 if (shdr_info[cnt].shdr.sh_type == SHT_REL in handle_elf()
754 || shdr_info[cnt].shdr.sh_type == SHT_RELA) in handle_elf()
756 if (shdr_info[cnt].shdr.sh_info >= shnum) in handle_elf()
758 else if (shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0) in handle_elf()
764 if (shdr_info[cnt].shdr.sh_type == SHT_GROUP) in handle_elf()
786 && (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM in handle_elf()
787 || shdr_info[cnt].shdr.sh_type == SHT_SYMTAB)) in handle_elf()
804 elf_assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB); in handle_elf()
870 if (shdr_info[shdr_info[cnt].shdr.sh_link].idx == 0) in handle_elf()
872 shdr_info[shdr_info[cnt].shdr.sh_link].idx = 1; in handle_elf()
873 changes |= shdr_info[cnt].shdr.sh_link < cnt; in handle_elf()
877 if (SH_INFO_LINK_P (&shdr_info[cnt].shdr)) in handle_elf()
879 if (shdr_info[cnt].shdr.sh_info >= shnum) in handle_elf()
881 else if ( shdr_info[shdr_info[cnt].shdr.sh_info].idx == 0) in handle_elf()
883 shdr_info[shdr_info[cnt].shdr.sh_info].idx = 1; in handle_elf()
884 changes |= shdr_info[cnt].shdr.sh_info < cnt; in handle_elf()
918 check_preserved (shdr_info[cnt].shdr.sh_link); in handle_elf()
919 if (SH_INFO_LINK_P (&shdr_info[cnt].shdr)) in handle_elf()
920 check_preserved (shdr_info[cnt].shdr.sh_info); in handle_elf()
940 && shdr_info[cnt].shdr.sh_type != SHT_NOTE in handle_elf()
941 && shdr_info[cnt].shdr.sh_type != SHT_GROUP in handle_elf()
945 GElf_Shdr debugshdr = shdr_info[cnt].shdr; in handle_elf()
972 || shdr_info[cnt].shdr.sh_type == SHT_GROUP) in handle_elf()
1046 shdr_info[cnt].shdr.sh_type = SHT_PROGBITS; in handle_elf()
1047 shdr_info[cnt].shdr.sh_flags = 0; in handle_elf()
1048 shdr_info[cnt].shdr.sh_addr = 0; in handle_elf()
1049 shdr_info[cnt].shdr.sh_link = SHN_UNDEF; in handle_elf()
1050 shdr_info[cnt].shdr.sh_info = SHN_UNDEF; in handle_elf()
1051 shdr_info[cnt].shdr.sh_entsize = 0; in handle_elf()
1052 shdr_info[cnt].shdr.sh_addralign = 4; in handle_elf()
1056 shdr_info[cnt].shdr.sh_offset = 0; in handle_elf()
1077 shdr_info[cnt].shdr.sh_size = shdr_info[cnt].data->d_size in handle_elf()
1103 shdr_info[cnt].shdr.sh_type = SHT_STRTAB; in handle_elf()
1104 shdr_info[cnt].shdr.sh_flags = 0; in handle_elf()
1105 shdr_info[cnt].shdr.sh_addr = 0; in handle_elf()
1106 shdr_info[cnt].shdr.sh_link = SHN_UNDEF; in handle_elf()
1107 shdr_info[cnt].shdr.sh_info = SHN_UNDEF; in handle_elf()
1108 shdr_info[cnt].shdr.sh_entsize = 0; in handle_elf()
1112 shdr_info[cnt].shdr.sh_offset = 0; in handle_elf()
1113 shdr_info[cnt].shdr.sh_addralign = 1; in handle_elf()
1133 shdr_info[cnt].shdr.sh_size = shstrtab_data->d_size; in handle_elf()
1146 shdr_info[cnt].shdr.sh_name = ebl_strtaboffset (shdr_info[cnt].se); in handle_elf()
1150 if (shdr_info[cnt].shdr.sh_link != 0) in handle_elf()
1151 shdr_info[cnt].shdr.sh_link = in handle_elf()
1152 shdr_info[shdr_info[cnt].shdr.sh_link].idx; in handle_elf()
1154 if (shdr_info[cnt].shdr.sh_type == SHT_GROUP) in handle_elf()
1166 if (SH_INFO_LINK_P (&shdr_info[cnt].shdr)) in handle_elf()
1167 shdr_info[cnt].shdr.sh_info = in handle_elf()
1168 shdr_info[shdr_info[cnt].shdr.sh_info].idx; in handle_elf()
1190 shdr_info[cnt].shdr.sh_size = shdr_info[cnt].data->d_size; in handle_elf()
1194 if (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM in handle_elf()
1195 || shdr_info[cnt].shdr.sh_type == SHT_SYMTAB) in handle_elf()
1205 assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX); in handle_elf()
1217 elf_assert (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM); in handle_elf()
1267 shdr_info[cnt].shdr.sh_info = destidx - 1; in handle_elf()
1317 shdr_info[cnt].shdr.sh_info = destidx - 1; in handle_elf()
1328 || ((shdr_info[sidx].shdr.sh_type in handle_elf()
1330 && (shdr_info[sidx].shdr.sh_info in handle_elf()
1338 shdr_info[cnt].shdr.sh_size = newdata->d_size in handle_elf()
1352 if (shdr_info[cnt].shdr.sh_offset == 0) in handle_elf()
1353 shdr_info[cnt].shdr.sh_offset in handle_elf()
1354 = ((lastoffset + shdr_info[cnt].shdr.sh_addralign - 1) in handle_elf()
1355 & ~((GElf_Off) (shdr_info[cnt].shdr.sh_addralign - 1))); in handle_elf()
1358 if (unlikely (gelf_update_shdr (scn, &shdr_info[cnt].shdr) == 0)) in handle_elf()
1363 GElf_Off filesz = (shdr_info[cnt].shdr.sh_type != SHT_NOBITS in handle_elf()
1364 ? shdr_info[cnt].shdr.sh_size : 0); in handle_elf()
1365 if (lastoffset < shdr_info[cnt].shdr.sh_offset + filesz) in handle_elf()
1366 lastoffset = shdr_info[cnt].shdr.sh_offset + filesz; in handle_elf()
1380 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in handle_elf() local
1381 shdr->sh_size = newdata->d_size; in handle_elf()
1382 (void) gelf_update_shdr (scn, shdr); in handle_elf()
1400 switch (shdr_info[cnt].shdr.sh_type) in handle_elf()
1426 size_t nrels = (shdr_info[cnt].shdr.sh_size in handle_elf()
1427 / shdr_info[cnt].shdr.sh_entsize); in handle_elf()
1429 if (shdr_info[cnt].shdr.sh_type == SHT_REL) in handle_elf()
1488 if (shdr_info[cnt].shdr.sh_entsize == sizeof (Elf32_Word)) in handle_elf()
1514 for (size_t inner = shdr_info[symtabidx].shdr.sh_info; in handle_elf()
1542 elf_assert (shdr_info[cnt].shdr.sh_entsize in handle_elf()
1568 for (size_t inner = shdr_info[symtabidx].shdr.sh_info; in handle_elf()
1644 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in handle_elf() local
1645 assert (shdr != NULL); in handle_elf()
1647 shdr->sh_info = newsymidx[shdr->sh_info]; in handle_elf()
1649 (void) gelf_update_shdr (scn, shdr); in handle_elf()
1668 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem); in handle_elf() local
1669 if (shdr->sh_type == SHT_REL || shdr->sh_type == SHT_RELA) in handle_elf()
1674 Elf_Scn *tscn = elf_getscn (debugelf, shdr->sh_info); in handle_elf()
1700 Elf64_Word symt = shdr->sh_link; in handle_elf()
1829 size_t nrels = shdr->sh_size / shdr->sh_entsize; in handle_elf()
1831 if (shdr->sh_type == SHT_REL) in handle_elf()
1861 shdr->sh_size = reldata->d_size = nrels * shdr->sh_entsize; in handle_elf()
1862 gelf_update_shdr (scn, shdr); in handle_elf()
1938 newehdr->e_shoff = ((shdr_info[shdridx].shdr.sh_offset in handle_elf()
1939 + shdr_info[shdridx].shdr.sh_size + offsize - 1) in handle_elf()
1951 if (gelf_getshdr (shdr_info[0].scn, &shdr_info[0].shdr) == NULL) in handle_elf()
1954 shdr_info[0].shdr.sh_link = idx; in handle_elf()
1955 (void) gelf_update_shdr (shdr_info[0].scn, &shdr_info[0].shdr); in handle_elf()
2007 || ftruncate64 (fd, shdr_info[shdridx].shdr.sh_offset) < 0) in handle_elf()
2027 || ftruncate64 (fd, shdr_info[shdridx].shdr.sh_offset) < 0) in handle_elf()