Lines Matching refs:ndx
175 setshdrstrndx (Elf *elf, GElf_Ehdr *ehdr, size_t ndx)
177 if (ndx < SHN_LORESERVE)
178 ehdr->e_shstrndx = ndx;
187 zshdr->sh_link = ndx;
200 const char *newname, size_t ndx,
212 ndx, name, elf_errmsg (-1));
219 ndx, name);
224 printf ("[%zd] %s %s", ndx, name,
234 error (0, 0, "Couldn't get shdr for section [%zd]", ndx);
248 set_section (unsigned int *sections, size_t ndx)
250 sections[ndx / WORD_BITS] |= (1U << (ndx % WORD_BITS));
254 get_section (unsigned int *sections, size_t ndx)
256 return (sections[ndx / WORD_BITS] & (1U << (ndx % WORD_BITS))) != 0;
424 size_t ndx = elf_ndxscn (scn);
425 if (ndx > shnum)
428 ndx, shnum);
436 error (0, 0, "Couldn't get shdr for section %zd", ndx);
443 error (0, 0, "Couldn't get name for section %zd", ndx);
454 printf ("[%zd] %s already decompressed\n", ndx, sname);
460 printf ("[%zd] %s already compressed\n", ndx, sname);
466 printf ("[%zd] %s already GNU compressed\n", ndx, sname);
471 set_section (sections, ndx);
490 printf ("[%zd] %s ignoring %s section\n", ndx, sname,
502 "Multiple symbol tables (%zd, %zd) using the same string table unsupported", symtabndx, ndx);
505 symtabndx = ndx;
652 size_t ndx = elf_ndxscn (scn);
653 assert (ndx < shnum);
658 if (get_section (sections, ndx))
664 error (0, 0, "Couldn't get shdr for section %zd", ndx);
672 error (0, 0, "Couldn't get name for section %zd", ndx);
685 && (ndx == shdrstrndx
686 || ndx == symtabndx));
693 if (compress_section (scn, size, sname, NULL, ndx,
702 if (compress_section (scn, size, sname, newname, ndx,
707 printf ("[%zd] %s already decompressed\n", ndx, sname);
717 if (compress_section (scn, size, sname, NULL, ndx,
729 if (ndx == shdrstrndx)
739 ndx, sname);
756 ndx, true, true,
769 ndx, sname);
772 ndx, sname);
783 if (compress_section (scn, size, sname, NULL, ndx,
794 if (ndx == shdrstrndx)
804 ndx, sname);
820 else if (compress_section (scn, size, sname, newname, ndx,
825 printf ("[%zd] %s already compressed\n", ndx, sname);
835 error (0, 0, "Couldn't create new section %zd", ndx);
843 error (0, 0, "Couldn't get shdr for section %zd", ndx);
849 error (0, 0, "Couldn't update section header %zd", ndx);
857 if (! adjust_names || ndx != shdrstrndx)
862 error (0, 0, "Couldn't get data from section %zd", ndx);
869 error (0, 0, "Couldn't create new data for section %zd", ndx);
887 error (0, 0, "Couldn't get name for section [%zd]", ndx);
893 name = scnnames[ndx] = xstrdup (name);
894 if ((scnstrents[ndx] = dwelf_strtab_add (names, name)) == NULL)
901 if (ndx == symtabndx)
912 if (compress_section (newscn, size, sname, NULL, ndx,
922 if (compress_section (newscn, size, sname, NULL, ndx,
935 ndx, name);
943 " while handling section [%zd] %s", ndx, name);
1109 size_t ndx = elf_ndxscn (scn);
1115 error (0, 0, "Couldn't get shdr for section %zd", ndx);
1133 shdr->sh_name = dwelf_strent_off (scnstrents[ndx]);
1137 error (0, 0, "Couldn't update section header %zd", ndx);
1141 if (adjust_names && ndx == symtabndx)
1150 ndx);