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 (_("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()
699 for (size_t cnt = 1; cnt < shdr->sh_size / sh_entsize; ++cnt) in check_symtab() local
701 sym = gelf_getsymshndx (data, xndxdata, cnt, &sym_mem, &xndx); in check_symtab()
705 idx, section_name (ebl, idx), cnt, elf_errmsg (-1)); in check_symtab()
715 idx, section_name (ebl, idx), cnt); in check_symtab()
730 idx, section_name (ebl, idx), cnt, name); in check_symtab()
736 xndxscnidx, section_name (ebl, xndxscnidx), cnt, name, in check_symtab()
748 idx, section_name (ebl, idx), cnt, name); in check_symtab()
755 idx, section_name (ebl, idx), cnt, name); in check_symtab()
762 idx, section_name (ebl, idx), cnt, name); in check_symtab()
767 idx, section_name (ebl, idx), cnt, name); in check_symtab()
775 idx, section_name (ebl, idx), cnt, name); in check_symtab()
776 if (cnt < shdr->sh_info) in check_symtab()
779 idx, section_name (ebl, idx), cnt, name); in check_symtab()
783 idx, section_name (ebl, idx), cnt, name); in check_symtab()
834 idx, section_name (ebl, idx), cnt, name); in check_symtab()
840 idx, section_name (ebl, idx), cnt, name, in check_symtab()
849 idx, section_name (ebl, idx), cnt, name, in check_symtab()
859 idx, section_name (ebl, idx), cnt, name, in check_symtab()
865 idx, section_name (ebl, idx), cnt, name, in check_symtab()
886 idx, section_name (ebl, idx), cnt, name); in check_symtab()
892 idx, section_name (ebl, idx), cnt, name); in check_symtab()
900 idx, section_name (ebl, idx), cnt, name, in check_symtab()
907 idx, section_name (ebl, idx), cnt, name, in check_symtab()
914 idx, section_name (ebl, idx), cnt, name, in check_symtab()
924 if (cnt >= shdr->sh_info) in check_symtab()
927 idx, section_name (ebl, idx), cnt, name); in check_symtab()
931 if (cnt < shdr->sh_info) in check_symtab()
934 idx, section_name (ebl, idx), cnt, name); in check_symtab()
941 idx, section_name (ebl, idx), cnt, name); in check_symtab()
1065 idx, section_name (ebl, idx), cnt, name); in check_symtab()
1069 idx, section_name (ebl, idx), cnt, name); in check_symtab()
1102 size_t cnt; in is_rel_dyn() local
1109 for (cnt = 1; cnt < rcshdr->sh_size / rcshdr->sh_entsize; ++cnt) in is_rel_dyn()
1112 GElf_Dyn *dyn = gelf_getdyn (d, cnt, &dyn_mem); in is_rel_dyn()
1373 size_t cnt, const GElf_Shdr *symshdr, Elf_Data *symdata, in check_one_reloc() argument
1382 idx, section_name (ebl, idx), cnt); in check_one_reloc()
1391 idx, section_name (ebl, idx), cnt); in check_one_reloc()
1399 idx, section_name (ebl, idx), cnt); in check_one_reloc()
1417 idx, section_name (ebl, idx), cnt, in check_one_reloc()
1434 idx, section_name (ebl, idx), cnt); in check_one_reloc()
1448 idx, section_name (ebl, idx), cnt, in check_one_reloc()
1469 idx, section_name (ebl, idx), cnt); in check_one_reloc()
1517 for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt) in check_rela() local
1520 GElf_Rela *rela = gelf_getrela (data, cnt, &rela_mem); in check_rela()
1525 idx, section_name (ebl, idx), cnt, elf_errmsg (-1)); in check_rela()
1529 check_one_reloc (ebl, ehdr, shdr, idx, cnt, symshdr, symdata, in check_rela()
1568 for (size_t cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt) in check_rel() local
1571 GElf_Rel *rel = gelf_getrel (data, cnt, &rel_mem); in check_rel()
1576 idx, section_name (ebl, idx), cnt, elf_errmsg (-1)); in check_rel()
1580 check_one_reloc (ebl, ehdr, shdr, idx, cnt, symshdr, symdata, in check_rel()
1604 size_t cnt; in check_dynamic() local
1685 for (cnt = 0; cnt < shdr->sh_size / sh_entsize; ++cnt) in check_dynamic()
1688 GElf_Dyn *dyn = gelf_getdyn (data, cnt, &dyn_mem); in check_dynamic()
1693 idx, section_name (ebl, idx), cnt, elf_errmsg (-1)); in check_dynamic()
1707 idx, section_name (ebl, idx), cnt); in check_dynamic()
1719 idx, section_name (ebl, idx), cnt, in check_dynamic()
1729 idx, section_name (ebl, idx), cnt, in check_dynamic()
1747 idx, section_name (ebl, idx), cnt); in check_dynamic()
1760 idx, section_name (ebl, idx), cnt, in check_dynamic()
1803 idx, section_name (ebl, idx), cnt, in check_dynamic()
1818 idx, section_name (ebl, idx), cnt, in check_dynamic()
1827 for (cnt = 1; cnt < DT_NUM; ++cnt) in check_dynamic()
1828 if (has_dt[cnt]) in check_dynamic()
1831 if (dependencies[cnt][inner] && ! has_dt[inner]) in check_dynamic()
1839 ebl_dynamic_tag_name (ebl, cnt, buf1, sizeof (buf1)), in check_dynamic()
1845 if (mandatory[cnt]) in check_dynamic()
1851 ebl_dynamic_tag_name (ebl, cnt, buf, sizeof (buf))); in check_dynamic()
1973 for (size_t cnt = idx + 1; cnt < shnum; ++cnt) in check_symtab_shndx() local
1976 GElf_Shdr *rshdr = gelf_getshdr (elf_getscn (ebl->elf, cnt), &rshdr_mem); in check_symtab_shndx()
1983 cnt, section_name (ebl, cnt)); in check_symtab_shndx()
2000 for (size_t cnt = 1; cnt < data->d_size / sizeof (Elf32_Word); ++cnt) in check_symtab_shndx() local
2002 Elf32_Word xndx = ((Elf32_Word *) data->d_buf)[cnt]; in check_symtab_shndx()
2007 GElf_Sym *sym = gelf_getsym (symdata, cnt, &sym_data); in check_symtab_shndx()
2010 ERROR (_("cannot get data for symbol %zu\n"), cnt); in check_symtab_shndx()
2054 size_t cnt; in check_sysv_hash() local
2055 for (cnt = 2; cnt < 2 + nbucket; ++cnt) in check_sysv_hash()
2057 if (buf + cnt >= end) in check_sysv_hash()
2059 else if (buf[cnt] >= maxidx) in check_sysv_hash()
2062 idx, section_name (ebl, idx), cnt - 2); in check_sysv_hash()
2065 for (; cnt < 2 + nbucket + nchain; ++cnt) in check_sysv_hash()
2067 if (buf + cnt >= end) in check_sysv_hash()
2069 else if (buf[cnt] >= maxidx) in check_sysv_hash()
2072 idx, section_name (ebl, idx), cnt - 2 - nbucket); in check_sysv_hash()
2111 size_t cnt; in check_sysv_hash64() local
2112 for (cnt = 2; cnt < 2 + nbucket; ++cnt) in check_sysv_hash64()
2114 if (buf + cnt >= end) in check_sysv_hash64()
2116 else if (buf[cnt] >= maxidx) in check_sysv_hash64()
2119 idx, section_name (ebl, idx), cnt - 2); in check_sysv_hash64()
2122 for (; cnt < 2 + nbucket + nchain; ++cnt) in check_sysv_hash64()
2124 if (buf + cnt >= end) in check_sysv_hash64()
2126 else if (buf[cnt] >= maxidx) in check_sysv_hash64()
2129 idx, section_name (ebl, idx), (uint64_t) cnt - 2 - nbucket); in check_sysv_hash64()
2201 size_t cnt; in check_gnu_hash() local
2202 for (cnt = 4 + bitmask_words; cnt < 4 + bitmask_words + nbuckets; ++cnt) in check_gnu_hash()
2204 Elf32_Word symidx = ((Elf32_Word *) data->d_buf)[cnt]; in check_gnu_hash()
2213 idx, section_name (ebl, idx), cnt - (4 + bitmask_words)); in check_gnu_hash()
2235 cnt - (4 + bitmask_words)); in check_gnu_hash()
2248 cnt - (4 + bitmask_words)); in check_gnu_hash()
2257 cnt - (4 + bitmask_words)); in check_gnu_hash()
2286 idx, section_name (ebl, idx), cnt - (4 + bitmask_words)); in check_gnu_hash()
2291 idx, section_name (ebl, idx), cnt - (4 + bitmask_words)); in check_gnu_hash()
2461 for (Elf32_Word cnt = 0; cnt < gnu_nbucket; ++cnt) in compare_hash_gnu_hash() local
2463 if (gnu_bucket[cnt] != STN_UNDEF) in compare_hash_gnu_hash()
2465 Elf32_Word symidx = gnu_bucket[cnt] - gnu_symbias; in compare_hash_gnu_hash()
2508 for (Elf32_Word cnt = 0; cnt < nbucket; ++cnt) in compare_hash_gnu_hash() local
2510 Elf32_Word symidx = bucket[cnt]; in compare_hash_gnu_hash()
2545 for (Elf64_Xword cnt = 0; cnt < nbucket; ++cnt) in compare_hash_gnu_hash() local
2547 Elf64_Xword symidx = bucket[cnt]; in compare_hash_gnu_hash()
2574 for (uint32_t cnt = 1; cnt < nentries; ++cnt) in compare_hash_gnu_hash() local
2575 if (used[cnt] != 0 && used[cnt] != 3) in compare_hash_gnu_hash()
2577 if (used[cnt] == 1) in compare_hash_gnu_hash()
2580 cnt, gnu_hash_idx, in compare_hash_gnu_hash()
2587 GElf_Sym *sym = gelf_getsym (sym_data, cnt, &sym_mem); in compare_hash_gnu_hash()
2592 cnt, hash_idx, in compare_hash_gnu_hash()
2686 size_t cnt; in check_group() local
2722 for (cnt = elsize; cnt + elsize <= data->d_size; cnt += elsize) in check_group()
2725 val = *((Elf32_Word *) ((char *) data->d_buf + cnt)); in check_group()
2727 memcpy (&val, (char *) data->d_buf + cnt, elsize); in check_group()
2733 idx, section_name (ebl, idx), cnt / elsize); in check_group()
2742 idx, section_name (ebl, idx), cnt / elsize, in check_group()
2755 idx, section_name (ebl, idx), cnt / elsize, in check_group()
2802 for (size_t cnt = 0; cnt < nknown_flags; ++cnt) in section_flags_string() local
2803 if (flags & known_flags[cnt].flag) in section_flags_string()
2811 size_t ncopy = MIN (len - 1, strlen (known_flags[cnt].name)); in section_flags_string()
2812 cp = mempcpy (cp, known_flags[cnt].name, ncopy); in section_flags_string()
2815 flags ^= known_flags[cnt].flag; in section_flags_string()
2979 for (int cnt = 1; (size_t) cnt < shdr->sh_size / shdr->sh_entsize; ++cnt) in check_versym() local
2982 GElf_Versym *versym = gelf_getversym (data, cnt, &versym_mem); in check_versym()
2987 idx, section_name (ebl, idx), cnt); in check_versym()
2992 GElf_Sym *sym = gelf_getsym (symdata, cnt, &sym_mem); in check_versym()
3003 idx, section_name (ebl, idx), cnt); in check_versym()
3011 idx, section_name (ebl, idx), cnt); in check_versym()
3025 idx, section_name (ebl, idx), cnt, (int) *versym); in check_versym()
3030 idx, section_name (ebl, idx), cnt, (int) *versym); in check_versym()
3036 if (!has_copy_reloc (ebl, shdr->sh_link, cnt) in check_versym()
3040 idx, section_name (ebl, idx), cnt, (int) *versym); in check_versym()
3111 for (Elf64_Word cnt = shdr->sh_info; cnt > 0; ) in check_verneed() local
3113 cnt--; in check_verneed()
3126 idx, section_name (ebl, idx), cnt, (int) need->vn_version); in check_verneed()
3133 idx, section_name (ebl, idx), cnt); in check_verneed()
3143 idx, section_name (ebl, idx), cnt); in check_verneed()
3151 idx, section_name (ebl, idx), cnt); in check_verneed()
3163 idx, section_name (ebl, idx), need->vn_cnt - cnt2, cnt); in check_verneed()
3171 idx, section_name (ebl, idx), need->vn_cnt - cnt2, cnt); in check_verneed()
3181 cnt, (int) hashval, (int) aux->vna_hash); in check_verneed()
3190 cnt, verstr); in check_verneed()
3200 idx, section_name (ebl, idx), need->vn_cnt - cnt2, cnt); in check_verneed()
3212 if ((need->vn_next != 0 || cnt > 0) in check_verneed()
3217 idx, section_name (ebl, idx), cnt); in check_verneed()
3221 if (need->vn_next == 0 && cnt > 0) in check_verneed()
3225 idx, section_name (ebl, idx), cnt); in check_verneed()
3272 for (Elf64_Word cnt = shdr->sh_info; cnt > 0; ) in check_verdef() local
3274 cnt--; in check_verdef()
3297 idx, section_name (ebl, idx), cnt); in check_verdef()
3302 idx, section_name (ebl, idx), cnt, (int) def->vd_version); in check_verdef()
3309 idx, section_name (ebl, idx), cnt); in check_verdef()
3324 idx, section_name (ebl, idx), cnt); in check_verdef()
3331 idx, section_name (ebl, idx), cnt, (int) hashval, in check_verdef()
3339 idx, section_name (ebl, idx), cnt, name); in check_verdef()
3359 idx, section_name (ebl, idx), cnt); in check_verdef()
3376 idx, section_name (ebl, idx), cnt); in check_verdef()
3388 if ((def->vd_next != 0 || cnt > 0) in check_verdef()
3393 idx, section_name (ebl, idx), cnt); in check_verdef()
3397 if (def->vd_next == 0 && cnt > 0) in check_verdef()
3401 idx, section_name (ebl, idx), cnt); in check_verdef()
3753 for (size_t cnt = 1; cnt < shnum; ++cnt) in check_sections() local
3755 Elf_Scn *scn = elf_getscn (ebl->elf, cnt); in check_sections()
3761 cnt, section_name (ebl, cnt), elf_errmsg (-1)); in check_sections()
3768 ERROR (_("section [%2zu]: invalid name\n"), cnt); in check_sections()
3797 (int) cnt, scnname, in check_sections()
3814 cnt, scnname, in check_sections()
3832 cnt, scnname, in check_sections()
3849 cnt, scnname); in check_sections()
3855 cnt, scnname); in check_sections()
3860 cnt, scnname); in check_sections()
3868 cnt, scnname); in check_sections()
3887 cnt, scnname); in check_sections()
3892 cnt, scnname); in check_sections()
3901 eh_frame_hdr_scnndx = cnt; in check_sections()
3903 eh_frame_scnndx = cnt; in check_sections()
3905 gcc_except_table_scnndx = cnt; in check_sections()
3911 cnt, section_name (ebl, cnt)); in check_sections()
3925 cnt, section_name (ebl, cnt), in check_sections()
3947 cnt, section_name (ebl, cnt), sh_flags & SHF_MASKPROC); in check_sections()
3956 cnt, section_name (ebl, cnt), sh_flags); in check_sections()
3964 cnt, section_name (ebl, cnt)); in check_sections()
3974 cnt, section_name (ebl, cnt)); in check_sections()
3979 cnt, section_name (ebl, cnt)); in check_sections()
3985 cnt, section_name (ebl, cnt), elf_errmsg (-1)); in check_sections()
3991 cnt, section_name (ebl, cnt)); in check_sections()
3996 cnt, section_name (ebl, cnt)); in check_sections()
4003 cnt, section_name (ebl, cnt)); in check_sections()
4008 cnt, section_name (ebl, cnt)); in check_sections()
4011 check_scn_group (ebl, cnt); in check_sections()
4027 cnt, section_name (ebl, cnt), shdr->sh_type); in check_sections()
4036 cnt, section_name (ebl, cnt)); in check_sections()
4039 && !ebl_check_special_section (ebl, cnt, shdr, in check_sections()
4040 section_name (ebl, cnt))) in check_sections()
4043 cnt, section_name (ebl, cnt)); in check_sections()
4074 cnt, section_name (ebl, cnt), pcnt); in check_sections()
4084 cnt, section_name (ebl, cnt), pcnt); in check_sections()
4110 cnt, section_name (ebl, cnt), pcnt); in check_sections()
4121 cnt, section_name (ebl, cnt), pcnt); in check_sections()
4132 cnt, section_name (ebl, cnt), pcnt); in check_sections()
4142 cnt, section_name (ebl, cnt), pcnt); in check_sections()
4152 cnt, section_name (ebl, cnt)); in check_sections()
4155 if (cnt == shstrndx && shdr->sh_type != SHT_STRTAB) in check_sections()
4158 cnt, section_name (ebl, cnt)); in check_sections()
4166 cnt, section_name (ebl, cnt)); in check_sections()
4169 check_symtab (ebl, ehdr, shdr, cnt); in check_sections()
4173 check_rela (ebl, ehdr, shdr, cnt); in check_sections()
4177 check_rel (ebl, ehdr, shdr, cnt); in check_sections()
4181 check_dynamic (ebl, ehdr, shdr, cnt); in check_sections()
4185 check_symtab_shndx (ebl, ehdr, shdr, cnt); in check_sections()
4189 check_hash (shdr->sh_type, ebl, ehdr, shdr, cnt); in check_sections()
4190 hash_idx = cnt; in check_sections()
4194 check_hash (shdr->sh_type, ebl, ehdr, shdr, cnt); in check_sections()
4195 gnu_hash_idx = cnt; in check_sections()
4199 check_null (ebl, shdr, cnt); in check_sections()
4203 check_group (ebl, ehdr, shdr, cnt); in check_sections()
4207 check_note_section (ebl, ehdr, shdr, cnt); in check_sections()
4216 versym_scnndx = cnt; in check_sections()
4220 check_verneed (ebl, shdr, cnt); in check_sections()
4224 check_verdef (ebl, shdr, cnt); in check_sections()
4228 check_attributes (ebl, ehdr, shdr, cnt); in check_sections()
4415 check_note (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Phdr *phdr, int cnt) in check_note() argument
4421 cnt); in check_note()
4436 notes_size = check_note_data (ebl, ehdr, data, 0, cnt, phdr->p_offset); in check_note()
4440 cnt, elf_errmsg (-1)); in check_note()
4443 cnt, phdr->p_filesz - notes_size); in check_note()
4498 for (unsigned int cnt = 0; cnt < phnum; ++cnt) in check_program_header() local
4503 phdr = gelf_getphdr (ebl->elf, cnt, &phdr_mem); in check_program_header()
4507 cnt, elf_errmsg (-1)); in check_program_header()
4518 cnt, (uint64_t) phdr->p_type); in check_program_header()
4538 check_note (ebl, ehdr, phdr, cnt); in check_program_header()
4603 cnt, inner); in check_program_header()
4610 inner, cnt); in check_program_header()
4721 pt_gnu_eh_frame_pndx = cnt; in check_program_header()
4728 cnt); in check_program_header()
4734 program header entry %d: alignment not a power of 2\n"), cnt); in check_program_header()
4737 program header entry %d: file offset and virtual address not module of alignment\n"), cnt); in check_program_header()