Lines Matching defs:shdr
391 GElf_Shdr shdr;
396 Elf32_Word old_sh_link; /* Original value of shdr.sh_link. */
573 shdr) == NULL)
578 shdr_info[cnt].shdr.sh_name);
588 /* Remember the shdr.sh_link value. */
589 shdr_info[cnt].old_sh_link = shdr_info[cnt].shdr.sh_link;
595 || (shdr_info[cnt].shdr.sh_flags & SHF_ALLOC) == 0)
596 shdr_info[cnt].shdr.sh_offset = 0;
600 if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX))
602 assert (shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx == 0);
603 shdr_info[shdr_info[cnt].shdr.sh_link].symtab_idx = cnt;
605 else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GROUP))
628 else if (unlikely (shdr_info[cnt].shdr.sh_type == SHT_GNU_versym))
630 assert (shdr_info[shdr_info[cnt].shdr.sh_link].version_idx == 0);
631 shdr_info[shdr_info[cnt].shdr.sh_link].version_idx = cnt;
636 if ((shdr_info[cnt].shdr.sh_flags & SHF_GROUP) != 0)
644 shdr_info[cnt].shdr.sh_flags &= ~SHF_GROUP;
664 if (ebl_section_strip_p (ebl, ehdr, &shdr_info[cnt].shdr,
713 if ((shdr_info[cnt].shdr.sh_type == SHT_REL
714 || shdr_info[cnt].shdr.sh_type == SHT_RELA)
715 && shdr_info[shdr_info[cnt].shdr.sh_info].idx != 0)
726 && (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM
727 || shdr_info[cnt].shdr.sh_type == SHT_SYMTAB))
744 assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB);
807 if (shdr_info[shdr_info[cnt].shdr.sh_link].idx == 0)
809 shdr_info[shdr_info[cnt].shdr.sh_link].idx = 1;
810 changes |= shdr_info[cnt].shdr.sh_link < cnt;
814 if (SH_INFO_LINK_P (&shdr_info[cnt].shdr)
815 && shdr_info[shdr_info[cnt].shdr.sh_info].idx == 0)
817 shdr_info[shdr_info[cnt].shdr.sh_info].idx = 1;
818 changes |= shdr_info[cnt].shdr.sh_info < cnt;
850 check_preserved (shdr_info[cnt].shdr.sh_link);
851 if (SH_INFO_LINK_P (&shdr_info[cnt].shdr))
852 check_preserved (shdr_info[cnt].shdr.sh_info);
872 && shdr_info[cnt].shdr.sh_type != SHT_NOTE
876 GElf_Shdr debugshdr = shdr_info[cnt].shdr;
976 shdr_info[cnt].shdr.sh_type = SHT_PROGBITS;
977 shdr_info[cnt].shdr.sh_flags = 0;
978 shdr_info[cnt].shdr.sh_addr = 0;
979 shdr_info[cnt].shdr.sh_link = SHN_UNDEF;
980 shdr_info[cnt].shdr.sh_info = SHN_UNDEF;
981 shdr_info[cnt].shdr.sh_entsize = 0;
982 shdr_info[cnt].shdr.sh_addralign = 4;
986 shdr_info[cnt].shdr.sh_offset = 0;
1007 shdr_info[cnt].shdr.sh_size = shdr_info[cnt].data->d_size
1032 shdr_info[cnt].shdr.sh_type = SHT_STRTAB;
1033 shdr_info[cnt].shdr.sh_flags = 0;
1034 shdr_info[cnt].shdr.sh_addr = 0;
1035 shdr_info[cnt].shdr.sh_link = SHN_UNDEF;
1036 shdr_info[cnt].shdr.sh_info = SHN_UNDEF;
1037 shdr_info[cnt].shdr.sh_entsize = 0;
1041 shdr_info[cnt].shdr.sh_offset = 0;
1042 shdr_info[cnt].shdr.sh_addralign = 1;
1062 shdr_info[cnt].shdr.sh_size = shstrtab_data->d_size;
1075 shdr_info[cnt].shdr.sh_name = ebl_strtaboffset (shdr_info[cnt].se);
1079 if (shdr_info[cnt].shdr.sh_link != 0)
1080 shdr_info[cnt].shdr.sh_link =
1081 shdr_info[shdr_info[cnt].shdr.sh_link].idx;
1083 if (shdr_info[cnt].shdr.sh_type == SHT_GROUP)
1095 if (SH_INFO_LINK_P (&shdr_info[cnt].shdr))
1096 shdr_info[cnt].shdr.sh_info =
1097 shdr_info[shdr_info[cnt].shdr.sh_info].idx;
1119 shdr_info[cnt].shdr.sh_size = shdr_info[cnt].data->d_size;
1123 if (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM
1124 || shdr_info[cnt].shdr.sh_type == SHT_SYMTAB)
1134 assert (shdr_info[cnt].shdr.sh_type == SHT_SYMTAB_SHNDX);
1146 assert (shdr_info[cnt].shdr.sh_type == SHT_DYNSYM);
1196 shdr_info[cnt].shdr.sh_info = destidx - 1;
1246 shdr_info[cnt].shdr.sh_info = destidx - 1;
1259 shdr_info[cnt].shdr.sh_size = newdata->d_size
1273 if (shdr_info[cnt].shdr.sh_offset == 0)
1274 shdr_info[cnt].shdr.sh_offset
1275 = ((lastoffset + shdr_info[cnt].shdr.sh_addralign - 1)
1276 & ~((GElf_Off) (shdr_info[cnt].shdr.sh_addralign - 1)));
1279 if (unlikely (gelf_update_shdr (scn, &shdr_info[cnt].shdr) == 0))
1284 GElf_Off filesz = (shdr_info[cnt].shdr.sh_type != SHT_NOBITS
1285 ? shdr_info[cnt].shdr.sh_size : 0);
1286 if (lastoffset < shdr_info[cnt].shdr.sh_offset + filesz)
1287 lastoffset = shdr_info[cnt].shdr.sh_offset + filesz;
1301 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
1302 shdr->sh_size = newdata->d_size;
1303 (void) gelf_update_shdr (scn, shdr);
1321 switch (shdr_info[cnt].shdr.sh_type)
1347 size_t nrels = (shdr_info[cnt].shdr.sh_size
1348 / shdr_info[cnt].shdr.sh_entsize);
1350 if (shdr_info[cnt].shdr.sh_type == SHT_REL)
1409 if (shdr_info[cnt].shdr.sh_entsize == sizeof (Elf32_Word))
1435 for (size_t inner = shdr_info[symtabidx].shdr.sh_info;
1463 assert (shdr_info[cnt].shdr.sh_entsize
1489 for (size_t inner = shdr_info[symtabidx].shdr.sh_info;
1565 GElf_Shdr *shdr = gelf_getshdr (scn, &shdr_mem);
1566 assert (shdr != NULL);
1568 shdr->sh_info = newsymidx[shdr->sh_info];
1570 (void) gelf_update_shdr (scn, shdr);
1642 newehdr->e_shoff = ((shdr_info[shdridx].shdr.sh_offset
1643 + shdr_info[shdridx].shdr.sh_size + offsize - 1)
1655 if (gelf_getshdr (shdr_info[0].scn, &shdr_info[0].shdr) == NULL)
1658 shdr_info[0].shdr.sh_link = idx;
1659 (void) gelf_update_shdr (shdr_info[0].scn, &shdr_info[0].shdr);