Lines Matching refs:state

222 	 * our retained error state.
963 * Initialize a symbol table state structure
966 * state - State structure to be initialized
976 init_symtbl_state(SYMTBL_STATE *state, Cache *cache, Word shnum, Word secndx,
982 state->file = file;
983 state->ehdr = ehdr;
984 state->cache = cache;
985 state->osabi = osabi;
986 state->shnum = shnum;
987 state->seccache = &cache[secndx];
988 state->secndx = secndx;
989 state->secname = state->seccache->c_name;
990 state->flags = flags;
991 state->shxndx.checked = 0;
992 state->shxndx.data = NULL;
993 state->shxndx.n = 0;
995 shdr = state->seccache->c_shdr;
1002 file, state->secname);
1005 if ((state->seccache->c_data == NULL) ||
1006 (state->seccache->c_data->d_buf == NULL))
1010 state->symn = (Word)(shdr->sh_size / shdr->sh_entsize);
1011 state->sym = (Sym *)state->seccache->c_data->d_buf;
1018 file, state->secname, EC_WORD(shdr->sh_link));
1027 (versym->cache->c_shdr->sh_link == state->secndx))
1028 state->versym = versym;
1030 state->versym = NULL;
1040 symbols_getxindex(SYMTBL_STATE *state)
1045 state->shxndx.checked = 1; /* Note that we've been called */
1046 for (symcnt = 1; symcnt < state->shnum; symcnt++) {
1047 Cache *_cache = &state->cache[symcnt];
1051 (shdr->sh_link != state->secndx))
1062 state->shxndx.data = _cache->c_data->d_buf;
1063 state->shxndx.n = symn;
1072 * state - Symbol table state
1081 output_symbol(SYMTBL_STATE *state, Word symndx, Word info, Word disp_symndx,
1120 if (symndx >= state->symn) {
1122 state->file, state->secname, EC_WORD(symndx));
1130 if ((sym->st_shndx == SHN_XINDEX) && (state->shxndx.checked == 0))
1131 symbols_getxindex(state);
1134 symname = string(state->seccache, symndx,
1135 &state->cache[state->seccache->c_shdr->sh_link], state->file,
1141 if (state->ehdr->e_type == ET_CORE) {
1143 } else if (state->flags & FLG_CTL_FAKESHDR) {
1151 sec = conv_sym_shndx(state->osabi, state->ehdr->e_machine,
1154 (sym->st_shndx < state->shnum)) {
1156 tshdr = state->cache[shndx].c_shdr;
1157 sec = state->cache[shndx].c_name;
1159 if (state->shxndx.data) {
1162 if (symndx > state->shxndx.n) {
1165 state->file, state->secname,
1168 state->shxndx.data[symndx]) > state->shnum) {
1171 state->file, state->secname,
1175 tshdr = state->cache[shndx].c_shdr;
1176 sec = state->cache[shndx].c_name;
1181 state->file, state->secname, EC_WORD(symndx));
1184 (sym->st_shndx >= state->shnum)) {
1186 MSG_INTL(MSG_ERR_BADSYM5), state->file,
1187 state->secname, EC_WORD(symndx),
1188 demangle(symname, state->flags), sym->st_shndx);
1195 if (state->versym) {
1198 verndx = test_verndx = state->versym->data[symndx];
1199 gnuver = state->versym->gnu_full;
1218 if ((test_verndx > state->versym->max_verndx) &&
1221 state->file, state->secname, EC_WORD(symndx),
1222 EC_HALF(test_verndx), state->versym->max_verndx);
1237 MSG_INTL(MSG_ERR_BADSYM3), state->file,
1238 state->secname, EC_WORD(symndx),
1239 demangle(symname, state->flags));
1244 MSG_INTL(MSG_ERR_BADSYM4), state->file,
1245 state->secname, EC_WORD(symndx),
1246 demangle(symname, state->flags));
1269 if (state->ehdr->e_type != ET_REL)
1273 MSG_INTL(MSG_ERR_BADSYM6), state->file,
1274 state->secname, EC_WORD(symndx),
1275 demangle(symname, state->flags),
1295 MSG_INTL(MSG_ERR_BADSYM7), state->file,
1296 state->secname, EC_WORD(symndx),
1297 demangle(symname, state->flags), EC_XWORD(info));
1304 MSG_INTL(MSG_ERR_BADSYM8), state->file,
1305 state->secname, EC_WORD(symndx),
1306 demangle(symname, state->flags), EC_XWORD(info));
1312 Elf_syms_table_entry(0, ELF_DBG_ELFDUMP, index, state->osabi,
1313 state->ehdr->e_machine, sym, verndx, gnuver, sec, symname);
1323 SYMTBL_STATE state;
1391 if (!init_symtbl_state(&state, cache, shnum,
1537 output_symbol(&state, inum, 0,
1538 inum, state.sym + inum);
1623 sym = (Sym *)(state.sym + inum);
1653 if (sndx > state.symn) {
1660 sym = (Sym *)(state.sym + sndx);
2444 SYMTBL_STATE state;
2463 if (!init_symtbl_state(&state, cache, shnum, secndx, ehdr,
2470 dbg_print(0, MSG_INTL(MSG_ELF_SCN_SYMTAB), state.secname);
2473 for (symcnt = 0; symcnt < state.symn; symcnt++)
2474 output_symbol(&state, symcnt, shdr->sh_info, symcnt,
2475 state.sym + symcnt);
3549 * parse_note_t is used to track the state used by parse_note_entry()
3572 * The state pns_ fields contain current values for the Note section
3575 * On success, True (1) is returned, the state pns_ fields have been
3577 * for the recovered note entry is found in the state pn_ fields.
3579 * On failure, False (0) is returned. The values contained in state
3583 parse_note_entry(parse_note_t *state)
3587 noteoff = (Word)state->pns_cache->c_data->d_size - state->pns_size;
3592 if (state->pns_size >= (sizeof (Word) * 3)) {
3593 state->pns_size -= (sizeof (Word) * 3);
3596 state->pns_file, state->pns_cache->c_name,
3604 if ((state->pn_namesz = *state->pns_data++) != 0) {
3605 if (state->pns_size >= state->pn_namesz) {
3606 state->pns_size -= state->pn_namesz;
3609 state->pns_file, state->pns_cache->c_name,
3610 EC_WORD(noteoff), EC_WORD(state->pn_namesz));
3618 if ((state->pn_descsz = *state->pns_data++) != 0) {
3623 if ((pad = (state->pn_namesz & (sizeof (Word) - 1))) != 0) {
3625 state->pns_size -= pad;
3627 if (state->pns_size >= state->pn_descsz) {
3628 state->pns_size -= state->pn_descsz;
3631 state->pns_file, state->pns_cache->c_name,
3632 EC_WORD(noteoff), EC_WORD(state->pn_namesz));
3637 state->pn_type = *state->pns_data++;
3640 if (state->pn_namesz) {
3641 state->pn_name = (char *)state->pns_data;
3642 pad = (state->pn_namesz +
3645 state->pns_data = (Word *)(state->pn_name + pad);
3653 if ((pad = (state->pn_descsz & (sizeof (Word) - 1))) != 0) {
3655 if (state->pns_size > pad)
3656 state->pns_size -= pad;
3660 if (state->pn_descsz) {
3661 state->pn_desc = (const char *)state->pns_data;
3663 state->pns_data = (Word *)(state->pn_desc +
3664 state->pn_descsz + pad);