Lines Matching refs:fstate
347 sinfo_list_alloc(FSTATE *fstate, SINFO_LISTELT *root)
354 fstate->file, strerror(err));
394 * fstate - Object state
419 map_addr_to_offset(FSTATE *fstate, Addr addr, size_t size, size_t *zero_bytes,
425 Phdr *phdr = fstate->phdr;
426 size_t phnum = fstate->phnum;
479 map_offset_to_addr(FSTATE *fstate, Off offset, size_t size, size_t *zero_bytes,
484 Phdr *phdr = fstate->phdr;
485 size_t phnum = fstate->phnum;
537 xlate_data(FSTATE *fstate, void *buf, size_t nbyte, Elf_Type xlate_type)
545 data.d_version = fstate->ehdr->e_version;
549 fstate->ehdr->e_ident[EI_DATA]) == NULL) {
550 failure(fstate->file, MSG_ORIG(MSG_ELF_XLATETOM));
563 * fstate - Object state
580 read_data(FSTATE *fstate, Off offset, void *buf, size_t nbyte,
583 if (pread(fstate->fd, buf, nbyte, offset) != nbyte) {
587 fstate->file, strerror(err));
592 return (xlate_data(fstate, buf, nbyte, xlate_type));
610 hash_size(FSTATE *fstate, SINFO *hash_sinfo,
616 offset = map_addr_to_offset(fstate, hash_sinfo->vaddr,
621 if (read_data(fstate, offset, buf, sizeof (buf), ELF_T_WORD) == 0)
637 read_verdef(FSTATE *fstate, Off offset, Half *cnt, Word *aux, Word *next)
641 if (read_data(fstate, offset, &verdef, sizeof (verdef),
646 if (xlate_data(fstate, &verdef.vd_cnt, sizeof (verdef.vd_cnt),
654 if (xlate_data(fstate, &verdef.vd_aux,
672 read_verdaux(FSTATE *fstate, Off offset, Word *next)
676 if (read_data(fstate, offset, &verdaux, sizeof (verdaux),
681 if (xlate_data(fstate, &verdaux.vda_next, sizeof (verdaux.vda_next),
697 read_verneed(FSTATE *fstate, Off offset, Half *cnt, Word *aux, Word *next)
701 if (read_data(fstate, offset, &verneed, sizeof (verneed),
706 if (xlate_data(fstate, &verneed.vn_cnt, sizeof (verneed.vn_cnt),
714 if (xlate_data(fstate, &verneed.vn_aux,
732 read_vernaux(FSTATE *fstate, Off offset, Word *next)
736 if (read_data(fstate, offset, &vernaux, sizeof (vernaux),
741 if (xlate_data(fstate, &vernaux.vna_next, sizeof (vernaux.vna_next),
772 * fstate - Object state
780 verdefneed_size(FSTATE *fstate, SINFO *sec)
818 offset = highwater = map_addr_to_offset(fstate, sec->vaddr,
830 if ((*read_main)(fstate, offset, &v_cnt, &v_aux, &v_next) == 0)
844 if ((*read_aux)(fstate, aux_offset, &va_next) == 0)
860 * fstate - Object state
873 get_data(FSTATE *fstate, SINFO *sec)
892 fstate->file, strerror(err));
924 sec->shdr->sh_addr = map_offset_to_addr(fstate, sec->offset,
933 sec->shdr->sh_offset = map_addr_to_offset(fstate,
1006 sec->data->d_version = fstate->ehdr->e_version;
1018 fstate->file, strerror(err));
1024 (read_data(fstate, sec->shdr->sh_offset, sec->data->d_buf,
1034 fstate->ehdr->e_ident[EI_DATA]) == NULL)) {
1036 failure(fstate->file, MSG_ORIG(MSG_ELF_XLATETOM));
1126 FSTATE fstate;
1134 fstate.file = file;
1135 fstate.fd = fd;
1136 fstate.ehdr = ehdr;
1137 if (elf_getphdrnum(elf, &fstate.phnum) == -1) {
1141 if ((fstate.phdr = elf_getphdr(elf)) == NULL) {
1155 for (ndx = 0; ndx < fstate.phnum; ndx++) {
1160 if (fstate.phdr[ndx].p_filesz == 0)
1164 switch (fstate.phdr[ndx].p_type) {
1180 if ((sinfo = sinfo_list_alloc(&fstate, &seclist)) ==
1203 sinfo->vaddr = fstate.phdr[ndx].p_vaddr;
1204 sinfo->offset = fstate.phdr[ndx].p_offset;
1205 sinfo->size = fstate.phdr[ndx].p_filesz;
1213 (void) get_data(&fstate, &sec.dyn);
1402 if (hash_size(&fstate, &sec.hash,
1438 (verdefneed_size(&fstate, &sec.verdef) == 0))
1441 (verdefneed_size(&fstate, &sec.verneed) == 0))
1475 (void) get_data(&fstate, sinfo);
1483 (void) get_data(&fstate, sinfo);