Lines Matching defs:argstate

143  *	argstate - Address of ARGSTATE block to be initialized
146 * On success, *argstate is initialized. On error,
151 * argstate. Use the argstate_add_XXX() routines below to
156 SYMINFO_CMD_T cmd, ARGSTATE *argstate)
161 bzero(argstate, sizeof (*argstate));
162 argstate->obj_state = obj_state;
168 argstate->optmask |= getopt_ret->gor_idmask;
185 argstate->argc = argc;
186 argstate->argv = argv;
189 argstate->syminfo.sec = elfedit_sec_getsyminfo(obj_state,
190 &argstate->syminfo.data, &argstate->syminfo.n);
207 * argstate - State block for current symbol table.
212 * Otherwise, the fields in argstate have been filled in, ready
217 argstate_add_sym(ARGSTATE *argstate)
219 if (argstate->sym.sec != NULL)
222 argstate->sym.sec = elfedit_sec_getsymtab(argstate->obj_state,
223 1, argstate->syminfo.sec->sec_shdr->sh_link, NULL,
224 &argstate->sym.data, &argstate->sym.n, NULL);
227 argstate_add_str(ARGSTATE *argstate)
229 if (argstate->str.sec != NULL)
232 argstate_add_sym(argstate);
233 argstate->str.sec = elfedit_sec_getstr(argstate->obj_state,
234 argstate->sym.sec->sec_shdr->sh_link, 0);
237 argstate_add_dynamic(ARGSTATE *argstate)
239 if (argstate->dynamic.sec != NULL)
242 argstate->dynamic.sec = elfedit_sec_getdyn(argstate->obj_state,
243 &argstate->dynamic.data, &argstate->dynamic.n);
252 * argstate - State block for current symbol table.
257 dump_syminfo(ARGSTATE *argstate, Word ndx, Word cnt)
263 syminfo = argstate->syminfo.data + ndx;
265 argstate_add_sym(argstate);
266 sym = argstate->sym.data + ndx;
268 argstate_add_str(argstate);
270 argstate_add_dynamic(argstate);
271 dyn = argstate->dynamic.data;
281 name = elfedit_offset_to_str(argstate->str.sec,
285 (syminfo->si_boundto < argstate->dynamic.n) &&
288 needed = elfedit_offset_to_str(argstate->str.sec,
308 * argstate - State block for current symbol table.
313 print_syminfo(SYMINFO_CMD_T cmd, int autoprint, ARGSTATE *argstate,
336 dump_syminfo(argstate, ndx, cnt);
340 syminfo = argstate->syminfo.data;
346 argstate_add_dynamic(argstate);
347 argstate_add_str(argstate);
375 (argstate->dynamic.sec != NULL) &&
376 (bndto < argstate->dynamic.n) &&
377 (argstate->dynamic.data[bndto].d_tag ==
380 argstate->str.sec,
381 argstate->dynamic.data[bndto].
423 * argstate - State block for current symbol table.
431 arg_to_symndx(ARGSTATE *argstate, const char *arg)
439 if (argstate->optmask & SYMINFO_OPT_F_SYMNDX)
441 0, argstate->syminfo.n - 1, NULL));
447 argstate_add_sym(argstate);
448 argstate_add_str(argstate);
450 (void) elfedit_name_to_symndx(argstate->sym.sec,
451 argstate->str.sec, arg, ELFEDIT_MSG_ERR, &symndx);
462 needed_to_boundto(ARGSTATE *argstate, const char *arg)
473 argstate_add_str(argstate);
474 argstate_add_dynamic(argstate);
475 dynsec = argstate->dynamic.sec;
476 numdyn = argstate->dynamic.n;
483 dyn = argstate->dynamic.data;
494 if (elfedit_test_osabi(argstate->obj_state,
506 have_string = elfedit_sec_findstr(argstate->str.sec,
509 dyn = argstate->dynamic.data;
535 argstate->str.sec, &strpad_elt, arg);
542 argstate->obj_state->os_ehdr->e_ident[EI_OSABI],
543 argstate->obj_state->os_ehdr->e_machine,
545 dyn = argstate->dynamic.data + ndx;
571 ARGSTATE argstate;
576 process_args(obj_state, argc, argv, cmd, &argstate);
579 if (argstate.argc == 0) {
580 print_syminfo(cmd, 0, &argstate, 0, argstate.syminfo.n);
585 ndx = arg_to_symndx(&argstate, argstate.argv[0]);
588 if (argstate.argc == 1) {
589 print_syminfo(cmd, 0, &argstate, ndx, 1);
593 syminfo = &argstate.syminfo.data[ndx];
601 EC_WORD(argstate.syminfo.sec->sec_shndx),
602 argstate.syminfo.sec->sec_name, EC_WORD(ndx));
616 if (argstate.optmask & SYMINFO_OPT_F_NEEDED)
617 boundto = needed_to_boundto(&argstate,
618 argstate.argv[1]);
621 argstate.argv[1], MSG_ORIG(MSG_STR_VALUE),
627 argstate.syminfo.sec->sec_shndx,
628 argstate.syminfo.sec->sec_name, ndx, name,
633 argstate.syminfo.sec->sec_shndx,
634 argstate.syminfo.sec->sec_name, ndx, name,
650 for (i = 1; i < argstate.argc; i++)
652 elfedit_atoconst(argstate.argv[i],
656 if (argstate.optmask & SYMINFO_OPT_F_CMP)
660 if (argstate.optmask & SYMINFO_OPT_F_AND)
662 else if (argstate.optmask & SYMINFO_OPT_F_OR)
669 argstate.syminfo.sec->sec_shndx,
670 argstate.syminfo.sec->sec_name, ndx, name,
676 argstate.syminfo.sec->sec_shndx,
677 argstate.syminfo.sec->sec_name, ndx, name,
692 elfedit_modified_data(argstate.syminfo.sec);
695 print_syminfo(cmd, 1, &argstate, ndx, 1);