Lines Matching refs:argstate
150 Word ndx; /* If argstate.argc > 0, this is the table index */
193 * argstate - Overall state block
199 * Otherwise, the fields in argstate have been filled in, ready
204 symstate_add_str(ARGSTATE *argstate, SYMSTATE *symstate)
209 symstate->str.sec = elfedit_sec_getstr(argstate->obj_state,
213 symstate_add_versym(ARGSTATE *argstate, SYMSTATE *symstate)
218 symstate->versym.sec = elfedit_sec_getversym(argstate->obj_state,
222 symstate_add_xshndx(ARGSTATE *argstate, SYMSTATE *symstate)
227 symstate->xshndx.sec = elfedit_sec_getxshndx(argstate->obj_state,
237 * argstate - Overall state block
243 dump_symtab(ARGSTATE *argstate, SYMSTATE *symstate, Word ndx, Word cnt)
251 elfedit_obj_state_t *obj_state = argstate->obj_state;
260 symstate_add_str(argstate, symstate);
265 symstate_add_versym(argstate, symstate);
269 symstate_add_xshndx(argstate, symstate);
297 * argstate - Overall state block
301 all_same(SYM_CMD_T cmd, ARGSTATE *argstate, elfedit_outstyle_t outstyle)
307 symstate1 = argstate->symstate;
308 for (tblndx = 0; tblndx < (argstate->numsymstate - 1);
338 symstate_add_str(argstate, symstate1);
339 symstate_add_str(argstate, symstate2);
364 symstate_add_xshndx(argstate,
372 symstate_add_xshndx(argstate,
418 * argstate - Overall state block
424 print_symstate(SYM_CMD_T cmd, ARGSTATE *argstate, SYMSTATE *symstate,
436 dump_symtab(argstate, symstate, ndx, cnt);
474 symstate_add_str(argstate, symstate);
496 symstate_add_xshndx(argstate, symstate);
506 elfedit_shndx_to_name(argstate->obj_state,
527 Half mach = argstate->obj_state->os_ehdr->e_machine;
586 * argstate - Overall state block
592 print_sym(SYM_CMD_T cmd, int autoprint, ARGSTATE *argstate)
615 symstate = argstate->symstate;
616 for (tblndx = 0; tblndx < argstate->numsymstate; tblndx++, symstate++) {
618 symstate_add_str(argstate, symstate);
620 symstate_add_versym(argstate, symstate);
622 symstate_add_xshndx(argstate, symstate);
629 symstate_add_str(argstate, symstate);
634 symstate_add_xshndx(argstate, symstate);
646 only_one = (argstate->numsymstate > 1) && (argstate->argc > 0) &&
648 all_same(cmd, argstate, outstyle);
651 symstate = argstate->symstate;
652 for (tblndx = 0; tblndx < argstate->numsymstate; tblndx++, symstate++) {
653 if (argstate->argc == 0) {
661 if ((tblndx > 0) && ((argstate->argc == 0) ||
665 print_symstate(cmd, argstate, symstate, outstyle, ndx, cnt);
678 * argstate - Overall state block
682 cmd_body_set_st_bind(ARGSTATE *argstate, SYMSTATE *symstate)
696 bind = elfedit_atoconst_range(argstate->argv[1],
740 cmd_body_set_st_name(ARGSTATE *argstate, SYMSTATE *symstate)
751 symstate_add_str(argstate, symstate);
752 if (argstate->optmask & SYM_OPT_F_NAMOFFSET) {
753 str_offset = elfedit_atoui(argstate->argv[1], NULL);
758 str_offset = elfedit_strtab_insert(argstate->obj_state,
759 symstate->str.sec, NULL, argstate->argv[1]);
792 cmd_body_set_st_shndx(ARGSTATE *argstate, SYMSTATE *symstate)
806 if (argstate->optmask & SYM_OPT_F_SECSHNDX)
807 shndx = elfedit_atoshndx(argstate->argv[1],
808 argstate->obj_state->os_shnum);
809 else if (argstate->optmask & SYM_OPT_F_SECSHTYP)
810 shndx = elfedit_type_to_shndx(argstate->obj_state,
811 elfedit_atoconst(argstate->argv[1], ELFEDIT_CONST_SHT));
813 shndx = elfedit_name_to_shndx(argstate->obj_state,
814 argstate->argv[1]);
825 (argstate->optmask & SYM_OPT_F_XSHINDEX));
841 symstate_add_xshndx(argstate, symstate);
853 symstate_add_xshndx(argstate, symstate);
898 elfedit_shndx_to_name(argstate->obj_state,
900 elfedit_shndx_to_name(argstate->obj_state, st_shndx));
907 elfedit_shndx_to_name(argstate->obj_state, st_shndx));
917 elfedit_shndx_to_name(argstate->obj_state,
919 elfedit_shndx_to_name(argstate->obj_state, xshndx));
929 elfedit_shndx_to_name(argstate->obj_state, xshndx));
937 cmd_body_set_st_type(ARGSTATE *argstate, SYMSTATE *symstate)
941 Half mach = argstate->obj_state->os_ehdr->e_machine;
951 type = elfedit_atoconst_range(argstate->argv[1],
977 cmd_body_set_st_visibility(ARGSTATE *argstate, SYMSTATE *symstate)
990 vis = elfedit_atoconst_range(argstate->argv[1],
1024 * argstate - Address of ARGSTATE block to be initialized
1027 * On success, *argstate is initialized. On error,
1032 * argstate. Use the argstate_add_XXX() routines below to
1040 * We reuse this same argstate, resizing it to the required
1043 static ARGSTATE *argstate;
1060 /* Calulate required size of argstate and realloc as necessary */
1064 argstate = elfedit_realloc(MSG_INTL(MSG_ALLOC_ARGSTATE),
1065 argstate, size);
1068 bzero(argstate, argstate_size);
1069 argstate->obj_state = obj_state;
1073 argstate->optmask |= getopt_ret->gor_idmask;
1109 if ((argstate->optmask & SYM_OPT_F_SYMNDX) && !explicit)
1124 argstate->argc = argc;
1125 argstate->argv = argv;
1140 symstate = argstate->symstate;
1165 if (argstate->optmask & SYM_OPT_F_SYMNDX) {
1167 argstate->argv[0], MSG_INTL(MSG_ARG_SYM), 0,
1187 symstate_add_str(argstate, symstate);
1194 symstate->str.sec, argstate->argv[0],
1201 argstate->numsymstate++;
1212 return (argstate);
1224 * argstate - Overall state block
1228 symstate_cmd_body(SYM_CMD_T cmd, ARGSTATE *argstate, SYMSTATE *symstate)
1247 ret = cmd_body_set_st_bind(argstate, symstate);
1254 elfedit_atoui(argstate->argv[1], NULL);
1279 ret = cmd_body_set_st_name(argstate, symstate);
1286 elfedit_atoui(argstate->argv[1], NULL);
1311 ret = cmd_body_set_st_shndx(argstate, symstate);
1316 Xword st_size = elfedit_atoui(argstate->argv[1], NULL);
1341 ret = cmd_body_set_st_type(argstate, symstate);
1346 Addr st_value = elfedit_atoui(argstate->argv[1], NULL);
1373 ret = cmd_body_set_st_visibility(argstate, symstate);
1408 ARGSTATE *argstate;
1412 argstate = process_args(obj_state, argc, argv, cmd);
1419 if (argstate->argc < 2) {
1420 print_sym(cmd, 0, argstate);
1434 if ((cmd == SYM_CMD_T_ST_NAME) && (argstate->numsymstate > 1) &&
1435 ((argstate->optmask & SYM_OPT_F_NAMOFFSET) == 0)) {
1436 symstate = argstate->symstate;
1437 for (tblndx = 0; tblndx < argstate->numsymstate;
1440 NULL, argstate->argv[1]);
1445 symstate = argstate->symstate;
1446 for (tblndx = 0; tblndx < argstate->numsymstate; tblndx++, symstate++)
1447 if (symstate_cmd_body(cmd, argstate, symstate) ==
1452 print_sym(cmd, 1, argstate);