Lines Matching refs:ndx
101 STR_OPT_F_SHNDX = 16, /* -shndx ndx: strtab spec. by index */
120 Word ndx; /* Table offset if (argc > 0) */
199 shndx_to_strtab(elfedit_obj_state_t *obj_state, Word ndx)
206 if (ndx < obj_state->os_shnum) {
207 Shdr *shdr = obj_state->os_secarr[ndx].sec_shdr;
213 ndx = shdr->sh_link;
221 ndx = shdr->sh_link;
222 if (ndx < obj_state->os_shnum)
223 ndx =
224 obj_state->os_secarr[ndx].sec_shdr->sh_link;
229 return (ndx);
252 Word ndx;
262 ndx = obj_state->os_ehdr->e_shstrndx;
272 ndx = elfedit_name_to_shndx(obj_state,
277 ndx = elfedit_atoui(getopt_ret->gor_value, NULL);
281 ndx = elfedit_type_to_shndx(obj_state,
330 argstate->str.sec = elfedit_sec_get(obj_state, ndx);
338 ndx = shndx_to_strtab(obj_state, ndx);
341 * If ndx is a string table, the following will issue the
345 argstate->str.sec = elfedit_sec_getstr(obj_state, ndx, 1);
398 argstate->str.ndx = (elfedit_atoui_range(argv[0],
403 &argstate->str.ndx) == 0)
410 argstate->str.ndx = 0;
430 Word ndx;
451 ndx = argstate->str.ndx;
453 str += ndx;
481 ndx += skip;
485 start_ndx = ndx;
488 ndx++;
492 if (start_ndx != ndx) {
495 EC_XWORD(start_ndx), EC_XWORD(ndx));
498 MSG_ORIG(MSG_FMT_INDEX), EC_XWORD(ndx));
502 if (start_ndx == ndx)
507 ndx += skip;
521 Word ndx = argstate->str.ndx;
535 if ((ndx + ncp) > strsec->sec_data->d_size)
538 EC_WORD(ndx), newstr);
541 if (((ndx + ncp) == strsec->sec_data->d_size) &&
545 EC_WORD(ndx), newstr);
552 if ((ndx == 0) && (*newstr != '\0'))
555 EC_WORD(ndx), newstr);
558 oldstr = ndx + (char *)strsec->sec_data->d_buf;
564 strsec->sec_shndx, strsec->sec_name, ndx, newstr);
578 EC_WORD(ndx), len, i);
586 Word new_pad_ndx = ndx + len + 1;
594 EC_WORD(ndx), EC_WORD(new_pad_ndx - pad_ndx),
608 strsec->sec_shndx, strsec->sec_name, ndx, len, oldstr, newstr);
623 Word ndx = argstate->str.ndx;
624 char *oldstr = ndx + (char *)strsec->sec_data->d_buf;
629 count = strsec->sec_data->d_size - argstate->str.ndx;
633 argstate->str.sec->sec_data->d_size - argstate->str.ndx,
644 strsec->sec_shndx, strsec->sec_name, ndx);
649 strsec->sec_shndx, strsec->sec_name, ndx, count);
691 argstate.str.ndx = elfedit_strtab_insert(obj_state,
753 Word ndx;
788 for (ndx = 0; ndx < obj_state->os_shnum; ndx++, sec++) {
824 Word ndx;
845 for (ndx = 0; ndx < num_opt; ndx++) {
846 if (strcmp(argv[ndx], MSG_ORIG(MSG_STR_MINUS_STRNDX)) == 0)
849 if ((ndx+1) < num_opt) {
850 if (strcmp(argv[ndx],
856 sec_name, argv[ndx+1]) == 0) {
860 } else if (strcmp(argv[ndx],
864 if (elfedit_atoui2(argv[ndx+1], NULL,
867 } else if (strcmp(argv[ndx],
872 if (elfedit_atoconst2(argv[ndx+1],