Lines Matching refs:cnt
343 size_t cnt; in check_elf_header() local
383 for (cnt = EI_PAD; cnt < EI_NIDENT; ++cnt) in check_elf_header()
384 if (ehdr->e_ident[cnt] != 0) in check_elf_header()
385 ERROR (gettext ("e_ident[%zu] is not zero\n"), cnt); in check_elf_header()
393 for (cnt = 0; cnt < nvalid_e_machine; ++cnt) in check_elf_header()
394 if (valid_e_machine[cnt] == ehdr->e_machine) in check_elf_header()
396 if (cnt == nvalid_e_machine) in check_elf_header()
559 size_t cnt; in check_scn_group() local
561 for (cnt = idx + 1; cnt < shnum; ++cnt) in check_scn_group()
563 Elf_Scn *scn = elf_getscn (ebl->elf, cnt); in check_scn_group()
589 if (cnt == shnum) in check_scn_group()
597 cnt, section_name (ebl, cnt)); in check_scn_group()
633 for (size_t cnt = 1; cnt < shnum; ++cnt) in check_symtab() local
634 if (cnt != (size_t) idx) in check_symtab()
636 Elf_Scn *xndxscn = elf_getscn (ebl->elf, cnt); in check_symtab()
695 for (size_t cnt = 1; cnt < shdr->sh_size / sh_entsize; ++cnt) in check_symtab() local
697 sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx); in check_symtab()
701 idx, section_name (ebl, idx), cnt, elf_errmsg (-1)); in check_symtab()
711 idx, section_name (ebl, idx), cnt); in check_symtab()
726 idx, section_name (ebl, idx), cnt); in check_symtab()
732 xndxscnidx, section_name (ebl, xndxscnidx), cnt, in check_symtab()
744 idx, section_name (ebl, idx), cnt); in check_symtab()
751 idx, section_name (ebl, idx), cnt); in check_symtab()
758 idx, section_name (ebl, idx), cnt); in check_symtab()
763 idx, section_name (ebl, idx), cnt); in check_symtab()
771 idx, section_name (ebl, idx), cnt); in check_symtab()
772 if (cnt < shdr->sh_info) in check_symtab()
775 idx, section_name (ebl, idx), cnt); in check_symtab()
779 idx, section_name (ebl, idx), cnt); in check_symtab()
830 idx, section_name (ebl, idx), cnt); in check_symtab()
836 idx, section_name (ebl, idx), cnt, in check_symtab()
845 idx, section_name (ebl, idx), cnt, in check_symtab()
855 idx, section_name (ebl, idx), cnt, in check_symtab()
861 idx, section_name (ebl, idx), cnt, in check_symtab()
882 idx, section_name (ebl, idx), cnt); in check_symtab()
888 idx, section_name (ebl, idx), cnt); in check_symtab()
896 idx, section_name (ebl, idx), cnt, in check_symtab()
903 idx, section_name (ebl, idx), cnt, in check_symtab()
910 idx, section_name (ebl, idx), cnt, in check_symtab()
920 if (cnt >= shdr->sh_info) in check_symtab()
923 idx, section_name (ebl, idx), cnt); in check_symtab()
927 if (cnt < shdr->sh_info) in check_symtab()
930 idx, section_name (ebl, idx), cnt); in check_symtab()
937 idx, section_name (ebl, idx), cnt); in check_symtab()
1061 idx, section_name (ebl, idx), cnt); in check_symtab()
1065 idx, section_name (ebl, idx), cnt); in check_symtab()
1098 size_t cnt; in is_rel_dyn() local
1105 for (cnt = 1; cnt < rcshdr->sh_size / rcshdr->sh_entsize; ++cnt) in is_rel_dyn()
1108 GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem); in is_rel_dyn()
1369 size_t cnt, const GElf_Shdr *symshdr, Elf_Data *symdata, in check_one_reloc() argument
1378 idx, section_name (ebl, idx), cnt); in check_one_reloc()
1387 idx, section_name (ebl, idx), cnt); in check_one_reloc()
1395 idx, section_name (ebl, idx), cnt); in check_one_reloc()
1413 idx, section_name (ebl, idx), cnt, in check_one_reloc()
1430 idx, section_name (ebl, idx), cnt); in check_one_reloc()
1444 idx, section_name (ebl, idx), cnt, in check_one_reloc()
1465 idx, section_name (ebl, idx), cnt); in check_one_reloc()
1513 for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt) in check_rela() local
1516 GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem); in check_rela()
1521 idx, section_name (ebl, idx), cnt, elf_errmsg (-1)); in check_rela()
1525 check_one_reloc (ebl, ehdr, shdr, idx, cnt, symshdr, symdata, in check_rela()
1564 for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt) in check_rel() local
1567 GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem); in check_rel()
1572 idx, section_name (ebl, idx), cnt, elf_errmsg (-1)); in check_rel()
1576 check_one_reloc (ebl, ehdr, shdr, idx, cnt, symshdr, symdata, in check_rel()
1600 size_t cnt; in check_dynamic() local
1681 for (cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt) in check_dynamic()
1684 GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem); in check_dynamic()
1689 idx, section_name (ebl, idx), cnt, elf_errmsg (-1)); in check_dynamic()
1703 idx, section_name (ebl, idx), cnt); in check_dynamic()
1715 idx, section_name (ebl, idx), cnt, in check_dynamic()
1725 idx, section_name (ebl, idx), cnt, in check_dynamic()
1743 idx, section_name (ebl, idx), cnt); in check_dynamic()
1756 idx, section_name (ebl, idx), cnt, in check_dynamic()
1799 idx, section_name (ebl, idx), cnt, in check_dynamic()
1814 idx, section_name (ebl, idx), cnt, in check_dynamic()
1823 for (cnt = 1; cnt < DT_NUM; ++cnt) in check_dynamic()
1824 if (has_dt[cnt]) in check_dynamic()
1827 if (dependencies[cnt][inner] && ! has_dt[inner]) in check_dynamic()
1835 ebl_dynamic_tag_name (ebl, cnt, buf1, sizeof (buf1)), in check_dynamic()
1841 if (mandatory[cnt]) in check_dynamic()
1847 ebl_dynamic_tag_name (ebl, cnt, buf, sizeof (buf))); in check_dynamic()
1969 for (size_t cnt = idx + 1; cnt < shnum; ++cnt) in check_symtab_shndx() local
1972 GElf_Shdr *rshdr = gelf_getshdr (elf_getscn (ebl->elf, cnt), &rshdr_mem); in check_symtab_shndx()
1979 cnt, section_name (ebl, cnt)); in check_symtab_shndx()
1996 for (size_t cnt = 1; cnt < data->d_size / sizeof (Elf32_Word); ++cnt) in check_symtab_shndx() local
1998 Elf32_Word xndx = ((Elf32_Word *) data->d_buf)[cnt]; in check_symtab_shndx()
2003 GElf_Sym *sym = gelf_getsym (symdata, cnt, &sym_data); in check_symtab_shndx()
2006 ERROR (gettext ("cannot get data for symbol %zu\n"), cnt); in check_symtab_shndx()
2050 size_t cnt; in check_sysv_hash() local
2051 for (cnt = 2; cnt < 2 + nbucket; ++cnt) in check_sysv_hash()
2053 if (buf + cnt >= end) in check_sysv_hash()
2055 else if (buf[cnt] >= maxidx) in check_sysv_hash()
2058 idx, section_name (ebl, idx), cnt - 2); in check_sysv_hash()
2061 for (; cnt < 2 + nbucket + nchain; ++cnt) in check_sysv_hash()
2063 if (buf + cnt >= end) in check_sysv_hash()
2065 else if (buf[cnt] >= maxidx) in check_sysv_hash()
2068 idx, section_name (ebl, idx), cnt - 2 - nbucket); in check_sysv_hash()
2107 size_t cnt; in check_sysv_hash64() local
2108 for (cnt = 2; cnt < 2 + nbucket; ++cnt) in check_sysv_hash64()
2110 if (buf + cnt >= end) in check_sysv_hash64()
2112 else if (buf[cnt] >= maxidx) in check_sysv_hash64()
2115 idx, section_name (ebl, idx), cnt - 2); in check_sysv_hash64()
2118 for (; cnt < 2 + nbucket + nchain; ++cnt) in check_sysv_hash64()
2120 if (buf + cnt >= end) in check_sysv_hash64()
2122 else if (buf[cnt] >= maxidx) in check_sysv_hash64()
2125 idx, section_name (ebl, idx), (uint64_t) cnt - 2 - nbucket); in check_sysv_hash64()
2197 size_t cnt; in check_gnu_hash() local
2198 for (cnt = 4 + bitmask_words; cnt < 4 + bitmask_words + nbuckets; ++cnt) in check_gnu_hash()
2200 Elf32_Word symidx = ((Elf32_Word *) data->d_buf)[cnt]; in check_gnu_hash()
2209 idx, section_name (ebl, idx), cnt - (4 + bitmask_words)); in check_gnu_hash()
2231 cnt - (4 + bitmask_words)); in check_gnu_hash()
2244 cnt - (4 + bitmask_words)); in check_gnu_hash()
2253 cnt - (4 + bitmask_words)); in check_gnu_hash()
2282 idx, section_name (ebl, idx), cnt - (4 + bitmask_words)); in check_gnu_hash()
2287 idx, section_name (ebl, idx), cnt - (4 + bitmask_words)); in check_gnu_hash()
2457 for (Elf32_Word cnt = 0; cnt < gnu_nbucket; ++cnt) in compare_hash_gnu_hash() local
2459 if (gnu_bucket[cnt] != STN_UNDEF) in compare_hash_gnu_hash()
2461 Elf32_Word symidx = gnu_bucket[cnt] - gnu_symbias; in compare_hash_gnu_hash()
2504 for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt) in compare_hash_gnu_hash() local
2506 Elf32_Word symidx = bucket[cnt]; in compare_hash_gnu_hash()
2541 for (Elf64_Xword cnt = 0; cnt < nbucket; ++cnt) in compare_hash_gnu_hash() local
2543 Elf64_Xword symidx = bucket[cnt]; in compare_hash_gnu_hash()
2570 for (uint32_t cnt = 1; cnt < nentries; ++cnt) in compare_hash_gnu_hash() local
2571 if (used[cnt] != 0 && used[cnt] != 3) in compare_hash_gnu_hash()
2573 if (used[cnt] == 1) in compare_hash_gnu_hash()
2576 cnt, gnu_hash_idx, in compare_hash_gnu_hash()
2583 GElf_Sym *sym = gelf_getsym (sym_data, cnt, &sym_mem); in compare_hash_gnu_hash()
2588 cnt, hash_idx, in compare_hash_gnu_hash()
2682 size_t cnt; in check_group() local
2718 for (cnt = elsize; cnt + elsize <= data->d_size; cnt += elsize) in check_group()
2721 val = *((Elf32_Word *) ((char *) data->d_buf + cnt)); in check_group()
2723 memcpy (&val, (char *) data->d_buf + cnt, elsize); in check_group()
2729 idx, section_name (ebl, idx), cnt / elsize); in check_group()
2738 idx, section_name (ebl, idx), cnt / elsize, in check_group()
2751 idx, section_name (ebl, idx), cnt / elsize, in check_group()
2795 for (size_t cnt = 0; cnt < nknown_flags; ++cnt) in section_flags_string() local
2796 if (flags & known_flags[cnt].flag) in section_flags_string()
2804 size_t ncopy = MIN (len - 1, strlen (known_flags[cnt].name)); in section_flags_string()
2805 cp = mempcpy (cp, known_flags[cnt].name, ncopy); in section_flags_string()
2808 flags ^= known_flags[cnt].flag; in section_flags_string()
2968 for (int cnt = 1; (size_t) cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) in check_versym() local
2971 GElf_Versym *versym = gelf_getversym (data, cnt, &versym_mem); in check_versym()
2976 idx, section_name (ebl, idx), cnt); in check_versym()
2981 GElf_Sym *sym = gelf_getsym (symdata, cnt, &sym_mem); in check_versym()
2992 idx, section_name (ebl, idx), cnt); in check_versym()
3000 idx, section_name (ebl, idx), cnt); in check_versym()
3014 idx, section_name (ebl, idx), cnt, (int) *versym); in check_versym()
3019 idx, section_name (ebl, idx), cnt, (int) *versym); in check_versym()
3025 if (!has_copy_reloc (ebl, shdr->sh_link, cnt) in check_versym()
3029 idx, section_name (ebl, idx), cnt, (int) *versym); in check_versym()
3100 for (Elf64_Word cnt = shdr->sh_info; cnt > 0; ) in check_verneed() local
3102 cnt--; in check_verneed()
3115 idx, section_name (ebl, idx), cnt, (int) need->vn_version); in check_verneed()
3122 idx, section_name (ebl, idx), cnt); in check_verneed()
3132 idx, section_name (ebl, idx), cnt); in check_verneed()
3140 idx, section_name (ebl, idx), cnt); in check_verneed()
3152 idx, section_name (ebl, idx), need->vn_cnt - cnt2, cnt); in check_verneed()
3160 idx, section_name (ebl, idx), need->vn_cnt - cnt2, cnt); in check_verneed()
3170 cnt, (int) hashval, (int) aux->vna_hash); in check_verneed()
3179 cnt, verstr); in check_verneed()
3189 idx, section_name (ebl, idx), need->vn_cnt - cnt2, cnt); in check_verneed()
3201 if ((need->vn_next != 0 || cnt > 0) in check_verneed()
3206 idx, section_name (ebl, idx), cnt); in check_verneed()
3210 if (need->vn_next == 0 && cnt > 0) in check_verneed()
3214 idx, section_name (ebl, idx), cnt); in check_verneed()
3261 for (Elf64_Word cnt = shdr->sh_info; cnt > 0; ) in check_verdef() local
3263 cnt--; in check_verdef()
3286 idx, section_name (ebl, idx), cnt); in check_verdef()
3291 idx, section_name (ebl, idx), cnt, (int) def->vd_version); in check_verdef()
3298 idx, section_name (ebl, idx), cnt); in check_verdef()
3313 idx, section_name (ebl, idx), cnt); in check_verdef()
3320 idx, section_name (ebl, idx), cnt, (int) hashval, in check_verdef()
3328 idx, section_name (ebl, idx), cnt, name); in check_verdef()
3348 idx, section_name (ebl, idx), cnt); in check_verdef()
3365 idx, section_name (ebl, idx), cnt); in check_verdef()
3377 if ((def->vd_next != 0 || cnt > 0) in check_verdef()
3382 idx, section_name (ebl, idx), cnt); in check_verdef()
3386 if (def->vd_next == 0 && cnt > 0) in check_verdef()
3390 idx, section_name (ebl, idx), cnt); in check_verdef()
3734 for (size_t cnt = 1; cnt < shnum; ++cnt) in check_sections() local
3736 Elf_Scn *scn = elf_getscn (ebl->elf, cnt); in check_sections()
3742 cnt, section_name (ebl, cnt), elf_errmsg (-1)); in check_sections()
3749 ERROR (gettext ("section [%2zu]: invalid name\n"), cnt); in check_sections()
3778 (int) cnt, scnname, in check_sections()
3796 cnt, scnname, in check_sections()
3814 cnt, scnname, in check_sections()
3832 cnt, scnname); in check_sections()
3838 cnt, scnname); in check_sections()
3843 cnt, scnname); in check_sections()
3851 cnt, scnname); in check_sections()
3870 cnt, scnname); in check_sections()
3875 cnt, scnname); in check_sections()
3884 eh_frame_hdr_scnndx = cnt; in check_sections()
3886 eh_frame_scnndx = cnt; in check_sections()
3888 gcc_except_table_scnndx = cnt; in check_sections()
3894 cnt, section_name (ebl, cnt)); in check_sections()
3908 cnt, section_name (ebl, cnt), in check_sections()
3925 cnt, section_name (ebl, cnt), sh_flags & SHF_MASKPROC); in check_sections()
3931 cnt, section_name (ebl, cnt), sh_flags); in check_sections()
3939 cnt, section_name (ebl, cnt)); in check_sections()
3949 cnt, section_name (ebl, cnt)); in check_sections()
3954 cnt, section_name (ebl, cnt)); in check_sections()
3960 cnt, section_name (ebl, cnt), elf_errmsg (-1)); in check_sections()
3966 cnt, section_name (ebl, cnt)); in check_sections()
3971 cnt, section_name (ebl, cnt)); in check_sections()
3978 cnt, section_name (ebl, cnt)); in check_sections()
3983 cnt, section_name (ebl, cnt)); in check_sections()
3986 check_scn_group (ebl, cnt); in check_sections()
4002 cnt, section_name (ebl, cnt), shdr->sh_type); in check_sections()
4011 cnt, section_name (ebl, cnt)); in check_sections()
4014 && !ebl_check_special_section (ebl, cnt, shdr, in check_sections()
4015 section_name (ebl, cnt))) in check_sections()
4018 cnt, section_name (ebl, cnt)); in check_sections()
4049 cnt, section_name (ebl, cnt), pcnt); in check_sections()
4059 cnt, section_name (ebl, cnt), pcnt); in check_sections()
4085 cnt, section_name (ebl, cnt), pcnt); in check_sections()
4096 cnt, section_name (ebl, cnt), pcnt); in check_sections()
4107 cnt, section_name (ebl, cnt), pcnt); in check_sections()
4117 cnt, section_name (ebl, cnt), pcnt); in check_sections()
4127 cnt, section_name (ebl, cnt)); in check_sections()
4130 if (cnt == shstrndx && shdr->sh_type != SHT_STRTAB) in check_sections()
4133 cnt, section_name (ebl, cnt)); in check_sections()
4141 cnt, section_name (ebl, cnt)); in check_sections()
4144 check_symtab (ebl, ehdr, shdr, cnt); in check_sections()
4148 check_rela (ebl, ehdr, shdr, cnt); in check_sections()
4152 check_rel (ebl, ehdr, shdr, cnt); in check_sections()
4156 check_dynamic (ebl, ehdr, shdr, cnt); in check_sections()
4160 check_symtab_shndx (ebl, ehdr, shdr, cnt); in check_sections()
4164 check_hash (shdr->sh_type, ebl, ehdr, shdr, cnt); in check_sections()
4165 hash_idx = cnt; in check_sections()
4169 check_hash (shdr->sh_type, ebl, ehdr, shdr, cnt); in check_sections()
4170 gnu_hash_idx = cnt; in check_sections()
4174 check_null (ebl, shdr, cnt); in check_sections()
4178 check_group (ebl, ehdr, shdr, cnt); in check_sections()
4182 check_note_section (ebl, ehdr, shdr, cnt); in check_sections()
4191 versym_scnndx = cnt; in check_sections()
4195 check_verneed (ebl, shdr, cnt); in check_sections()
4199 check_verdef (ebl, shdr, cnt); in check_sections()
4203 check_attributes (ebl, ehdr, shdr, cnt); in check_sections()
4390 check_note (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Phdr *phdr, int cnt) in check_note() argument
4396 cnt); in check_note()
4411 notes_size = check_note_data (ebl, ehdr, data, 0, cnt, phdr->p_offset); in check_note()
4415 cnt, elf_errmsg (-1)); in check_note()
4418 cnt, phdr->p_filesz - notes_size); in check_note()
4473 for (unsigned int cnt = 0; cnt < phnum; ++cnt) in check_program_header() local
4478 phdr = gelf_getphdr (ebl->elf, cnt, &phdr_mem); in check_program_header()
4482 cnt, elf_errmsg (-1)); in check_program_header()
4492 cnt, (uint64_t) phdr->p_type); in check_program_header()
4512 check_note (ebl, ehdr, phdr, cnt); in check_program_header()
4577 cnt, inner); in check_program_header()
4584 inner, cnt); in check_program_header()
4695 pt_gnu_eh_frame_pndx = cnt; in check_program_header()
4702 cnt); in check_program_header()
4708 program header entry %d: alignment not a power of 2\n"), cnt); in check_program_header()
4711 program header entry %d: file offset and virtual address not module of alignment\n"), cnt); in check_program_header()