Lines Matching defs:ebl
104 static void check_note_section (Ebl *ebl, GElf_Ehdr *ehdr,
319 section_name (Ebl *ebl, int idx)
324 shdr = gelf_getshdr (elf_getscn (ebl->elf, idx), &shdr_mem);
326 return elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
353 check_elf_header (Ebl *ebl, GElf_Ehdr *ehdr, size_t size)
386 ebl_osabi_name (ebl, ehdr->e_ident[EI_OSABI], buf, sizeof (buf)));
443 GElf_Shdr *shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem);
460 GElf_Shdr *shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem);
469 if (!ebl_machine_flag_check (ebl, ehdr->e_flags))
471 ebl_machine_flag_name (ebl, ehdr->e_flags, buf, sizeof (buf)));
474 if (gelf_getclass (ebl->elf) == ELFCLASS32)
491 else if (gelf_getclass (ebl->elf) == ELFCLASS64)
514 check_scn_group (Ebl *ebl, int idx)
524 Elf_Scn *scn = elf_getscn (ebl->elf, cnt);
552 idx, section_name (ebl, idx));
556 idx, section_name (ebl, idx),
557 cnt, section_name (ebl, cnt));
563 check_symtab (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
567 Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
571 idx, section_name (ebl, idx));
576 GElf_Shdr *strshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
584 shdr->sh_link, section_name (ebl, shdr->sh_link),
585 idx, section_name (ebl, idx));
596 Elf_Scn *xndxscn = elf_getscn (ebl->elf, cnt);
608 idx, section_name (ebl, idx));
616 if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT))
619 idx, section_name (ebl, idx));
627 idx, section_name (ebl, idx), 0, elf_errmsg (-1));
632 idx, section_name (ebl, idx), "st_name");
635 idx, section_name (ebl, idx), "st_value");
638 idx, section_name (ebl, idx), "st_size");
641 idx, section_name (ebl, idx), "st_info");
644 idx, section_name (ebl, idx), "st_other");
647 idx, section_name (ebl, idx), "st_shndx");
651 xndxscnidx, section_name (ebl, xndxscnidx));
660 idx, section_name (ebl, idx), cnt, elf_errmsg (-1));
670 idx, section_name (ebl, idx), cnt);
673 name = elf_strptr (ebl->elf, shdr->sh_link, sym->st_name);
683 idx, section_name (ebl, idx), cnt);
689 xndxscnidx, section_name (ebl, xndxscnidx), cnt,
701 idx, section_name (ebl, idx), cnt);
706 && !ebl_symbol_type_name (ebl, GELF_ST_TYPE (sym->st_info), NULL, 0))
708 idx, section_name (ebl, idx), cnt);
713 idx, section_name (ebl, idx), cnt);
721 idx, section_name (ebl, idx), cnt);
725 idx, section_name (ebl, idx), cnt);
729 idx, section_name (ebl, idx), cnt);
736 destshdr = gelf_getshdr (elf_getscn (ebl->elf, xndx), &destshdr_mem);
743 if (! ebl_check_special_symbol (ebl, ehdr, sym, name,
752 || strcmp (section_name (ebl, idx), ".symtab")
761 idx, section_name (ebl, idx), cnt);
767 idx, section_name (ebl, idx), cnt,
768 (int) xndx, section_name (ebl, xndx));
776 idx, section_name (ebl, idx), cnt,
777 (int) xndx, section_name (ebl, xndx));
786 idx, section_name (ebl, idx), cnt,
787 (int) xndx, section_name (ebl, xndx));
792 idx, section_name (ebl, idx), cnt,
793 (int) xndx, section_name (ebl, xndx));
803 phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem);
813 idx, section_name (ebl, idx), cnt);
821 idx, section_name (ebl, idx), cnt,
822 (int) xndx, section_name (ebl, xndx));
828 idx, section_name (ebl, idx), cnt,
829 (int) xndx, section_name (ebl, xndx));
835 idx, section_name (ebl, idx), cnt,
836 (int) xndx, section_name (ebl, xndx));
848 idx, section_name (ebl, idx), cnt);
855 idx, section_name (ebl, idx), cnt);
862 idx, section_name (ebl, idx), cnt);
871 GElf_Shdr *destshdr = gelf_getshdr (elf_getscn (ebl->elf, xndx),
879 while ((gscn = elf_nextscn (ebl->elf, gscn)) != NULL)
883 const char *sname = elf_strptr (ebl->elf,
905 : elf_strptr (ebl->elf, ehdr->e_shstrndx,
913 idx, section_name (ebl, idx), xndx);
920 idx, section_name (ebl, idx), xndx, sname);
925 if (!ebl_check_special_symbol (ebl, ehdr, sym, name,
935 idx, section_name (ebl, idx),
942 idx, section_name (ebl, idx),
950 idx, section_name (ebl, idx));
959 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem);
966 idx, section_name (ebl, idx),
973 idx, section_name (ebl, idx),
986 is_rel_dyn (Ebl *ebl, const GElf_Ehdr *ehdr, int idx, const GElf_Shdr *shdr,
994 if (strcmp (section_name (ebl, idx), is_rela ? ".rela.dyn" : ".rel.dyn"))
1000 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
1024 idx, section_name (ebl, idx));
1033 idx, section_name (ebl, idx),
1038 Elf_Data *reldata = elf_getdata (elf_getscn (ebl->elf,
1052 if (ebl_relative_reloc_p (ebl,
1058 idx, section_name (ebl, idx),
1064 idx, section_name (ebl, idx),
1076 idx, section_name (ebl, idx));
1085 idx, section_name (ebl, idx),
1090 Elf_Data *reldata = elf_getdata (elf_getscn (ebl->elf,
1104 if (ebl_relative_reloc_p (ebl,
1110 idx, section_name (ebl, idx),
1116 idx, section_name (ebl, idx),
1148 check_reloc_shdr (Ebl *ebl, const GElf_Ehdr *ehdr, const GElf_Shdr *shdr,
1157 idx, section_name (ebl, idx));
1160 *destshdrp = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_info),
1167 reldyn = is_rel_dyn (ebl, ehdr, idx, shdr, true);
1171 idx, section_name (ebl, idx));
1179 idx, section_name (ebl, idx));
1186 idx, section_name (ebl, idx));
1190 if (shdr->sh_entsize != gelf_fsize (ebl->elf, reltype, 1, EV_CURRENT))
1194 idx, section_name (ebl, idx));
1205 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, i, &phdr_mem);
1220 Elf_Scn *dynscn = gelf_offscn (ebl->elf, phdr->p_offset);
1269 check_one_reloc (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *relshdr, int idx,
1277 if (!ebl_reloc_type_check (ebl, GELF_R_TYPE (r_info)))
1279 idx, section_name (ebl, idx), cnt);
1285 && !ebl_reloc_valid_use (ebl, GELF_R_TYPE (r_info)))
1288 idx, section_name (ebl, idx), cnt);
1292 * gelf_fsize (ebl->elf, ELF_T_SYM, 1, EV_CURRENT)
1296 idx, section_name (ebl, idx), cnt);
1299 if (ebl_none_reloc_p (ebl, GELF_R_TYPE (r_info)))
1302 if (ebl_gotpc_reloc_check (ebl, GELF_R_TYPE (r_info)))
1310 && (name = elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name))
1314 idx, section_name (ebl, idx), cnt,
1315 ebl_reloc_type_name (ebl, GELF_R_SYM (r_info),
1331 idx, section_name (ebl, idx), cnt);
1337 if (ebl_copy_reloc_p (ebl, GELF_R_TYPE (r_info))
1345 idx, section_name (ebl, idx), cnt,
1346 ebl_symbol_type_name (ebl, GELF_ST_TYPE (sym->st_info),
1366 idx, section_name (ebl, idx), cnt);
1382 idx, section_name (ebl, idx));
1390 check_rela (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
1392 Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
1396 idx, section_name (ebl, idx));
1404 bool reldyn = check_reloc_shdr (ebl, ehdr, shdr, idx, ELF_T_RELA, &destshdr,
1407 Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link);
1421 idx, section_name (ebl, idx), cnt, elf_errmsg (-1));
1425 check_one_reloc (ebl, ehdr, shdr, idx, cnt, symshdr, symdata,
1440 check_rel (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
1442 Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
1446 idx, section_name (ebl, idx));
1454 bool reldyn = check_reloc_shdr (ebl, ehdr, shdr, idx, ELF_T_REL, &destshdr,
1457 Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link);
1471 idx, section_name (ebl, idx), cnt, elf_errmsg (-1));
1475 check_one_reloc (ebl, ehdr, shdr, idx, cnt, symshdr, symdata,
1494 check_dynamic (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
1551 data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
1555 idx, section_name (ebl, idx));
1559 strshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link), &strshdr_mem);
1563 shdr->sh_link, section_name (ebl, shdr->sh_link),
1564 idx, section_name (ebl, idx));
1566 if (shdr->sh_entsize != gelf_fsize (ebl->elf, ELF_T_DYN, 1, EV_CURRENT))
1569 idx, section_name (ebl, idx));
1573 idx, section_name (ebl, idx));
1584 idx, section_name (ebl, idx), cnt, elf_errmsg (-1));
1592 idx, section_name (ebl, idx));
1596 if (!ebl_dynamic_tag_check (ebl, dyn->d_tag))
1598 idx, section_name (ebl, idx), cnt);
1610 idx, section_name (ebl, idx), cnt,
1611 ebl_dynamic_tag_name (ebl, dyn->d_tag,
1620 idx, section_name (ebl, idx), cnt,
1621 ebl_dynamic_tag_name (ebl, dyn->d_tag,
1638 idx, section_name (ebl, idx), cnt);
1660 idx, section_name (ebl, idx), cnt,
1661 shdr->sh_link, section_name (ebl, shdr->sh_link));
1692 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, n, &phdr_mem);
1703 idx, section_name (ebl, idx), cnt,
1704 ebl_dynamic_tag_name (ebl, dyn->d_tag, buf,
1718 idx, section_name (ebl, idx), cnt,
1719 ebl_dynamic_tag_name (ebl, dyn->d_tag, buf,
1721 shdr->sh_link, section_name (ebl, shdr->sh_link));
1738 idx, section_name (ebl, idx),
1739 ebl_dynamic_tag_name (ebl, cnt, buf1, sizeof (buf1)),
1740 ebl_dynamic_tag_name (ebl, inner, buf2, sizeof (buf2)));
1750 idx, section_name (ebl, idx),
1751 ebl_dynamic_tag_name (ebl, cnt, buf, sizeof (buf)));
1759 idx, section_name (ebl, idx));
1766 idx, section_name (ebl, idx),
1774 idx, section_name (ebl, idx),
1781 idx, section_name (ebl, idx),
1791 idx, section_name (ebl, idx), "DT_GNU_PRELINKED");
1795 idx, section_name (ebl, idx), "DT_CHECKSUM");
1801 idx, section_name (ebl, idx));
1812 idx, section_name (ebl, idx), "DT_GNU_CONFLICTSZ");
1816 idx, section_name (ebl, idx), "DT_GNU_LIBLISTSZ");
1820 idx, section_name (ebl, idx), "DT_GNU_CONFLICT");
1824 idx, section_name (ebl, idx), "DT_GNU_LIBLIST");
1830 check_symtab_shndx (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
1836 idx, section_name (ebl, idx));
1840 Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link);
1846 idx, section_name (ebl, idx));
1854 idx, section_name (ebl, idx));
1861 idx, section_name (ebl, idx));
1865 idx, section_name (ebl, idx));
1870 GElf_Shdr *rshdr = gelf_getshdr (elf_getscn (ebl->elf, cnt), &rshdr_mem);
1876 idx, section_name (ebl, idx),
1877 cnt, section_name (ebl, cnt));
1882 Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
1911 check_sysv_hash (Ebl *ebl, GElf_Shdr *shdr, Elf_Data *data, int idx,
1920 idx, section_name (ebl, idx), (long int) shdr->sh_size,
1931 idx, section_name (ebl, idx));
1941 idx, section_name (ebl, idx), cnt - 2);
1947 idx, section_name (ebl, idx), cnt - 2 - nbucket);
1952 check_sysv_hash64 (Ebl *ebl, GElf_Shdr *shdr, Elf_Data *data, int idx,
1961 idx, section_name (ebl, idx), (long int) shdr->sh_size,
1972 idx, section_name (ebl, idx));
1982 idx, section_name (ebl, idx), cnt - 2);
1988 idx, section_name (ebl, idx), (uint64_t) (cnt - 2 - nbucket));
1993 check_gnu_hash (Ebl *ebl, GElf_Shdr *shdr, Elf_Data *data, int idx,
2003 idx, section_name (ebl, idx), bitmask_words);
2006 if (gelf_getclass (ebl->elf) == ELFCLASS64)
2014 idx, section_name (ebl, idx), (long int) shdr->sh_size,
2022 idx, section_name (ebl, idx), shift);
2031 Elf_Data *symdata = elf_getdata (elf_getscn (ebl->elf, shdr->sh_link), NULL);
2040 size_t classbits = gelf_getclass (ebl->elf) == ELFCLASS32 ? 32 : 64;
2054 idx, section_name (ebl, idx), cnt - (4 + bitmask_words));
2075 idx, section_name (ebl, idx), symidx,
2078 const char *symname = elf_strptr (ebl->elf, symshdr->sh_link,
2086 idx, section_name (ebl, idx), symidx,
2117 idx, section_name (ebl, idx), cnt - (4 + bitmask_words));
2122 idx, section_name (ebl, idx), cnt - (4 + bitmask_words));
2128 idx, section_name (ebl, idx));
2135 check_hash (int tag, Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
2141 idx, section_name (ebl, idx));
2145 Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
2149 idx, section_name (ebl, idx));
2154 GElf_Shdr *symshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
2159 idx, section_name (ebl, idx));
2162 ? (gelf_getclass (ebl->elf) == ELFCLASS32
2164 : (size_t) ebl_sysvhash_entrysize (ebl)))
2167 idx, section_name (ebl, idx));
2171 idx, section_name (ebl, idx));
2177 idx, section_name (ebl, idx));
2184 if (ebl_sysvhash_entrysize (ebl) == sizeof (Elf64_Xword))
2185 check_sysv_hash64 (ebl, shdr, data, idx, symshdr);
2187 check_sysv_hash (ebl, shdr, data, idx, symshdr);
2191 check_gnu_hash (ebl, shdr, data, idx, symshdr);
2202 compare_hash_gnu_hash (Ebl *ebl, GElf_Ehdr *ehdr, size_t hash_idx,
2205 Elf_Scn *hash_scn = elf_getscn (ebl->elf, hash_idx);
2209 Elf_Scn *gnu_hash_scn = elf_getscn (ebl->elf, gnu_hash_idx);
2225 hash_idx, elf_strptr (ebl->elf, shstrndx, hash_shdr->sh_name),
2227 elf_strptr (ebl->elf, shstrndx, gnu_hash_shdr->sh_name));
2231 Elf_Scn *sym_scn = elf_getscn (ebl->elf, hash_shdr->sh_link);
2303 elf_strptr (ebl->elf, shstrndx, gnu_hash_shdr->sh_name));
2306 hash_idx, elf_strptr (ebl->elf, shstrndx, hash_shdr->sh_name));
2315 elf_strptr (ebl->elf, shstrndx, gnu_hash_shdr->sh_name),
2317 elf_strptr (ebl->elf, shstrndx, hash_shdr->sh_name));
2327 elf_strptr (ebl->elf, shstrndx, hash_shdr->sh_name),
2329 elf_strptr (ebl->elf, shstrndx, gnu_hash_shdr->sh_name));
2336 check_null (Ebl *ebl, GElf_Shdr *shdr, int idx)
2341 idx, section_name (ebl, idx), #name)
2356 check_group (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
2362 idx, section_name (ebl, idx));
2367 Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link);
2372 idx, section_name (ebl, idx), elf_errmsg (-1));
2378 idx, section_name (ebl, idx));
2380 if (shdr->sh_info >= symshdr->sh_size / gelf_fsize (ebl->elf, ELF_T_SYM,
2384 idx, section_name (ebl, idx));
2388 idx, section_name (ebl, idx));
2396 idx, section_name (ebl, idx));
2397 else if (strcmp (elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name),
2401 idx, section_name (ebl, idx));
2406 idx, section_name (ebl, idx));
2409 Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
2412 idx, section_name (ebl, idx), elf_errmsg (-1));
2422 idx, section_name (ebl, idx));
2427 idx, section_name (ebl, idx));
2433 idx, section_name (ebl, idx));
2437 idx, section_name (ebl, idx));
2447 idx, section_name (ebl, idx));
2460 idx, section_name (ebl, idx), cnt / elsize);
2464 GElf_Shdr *refshdr = gelf_getshdr (elf_getscn (ebl->elf, val),
2469 idx, section_name (ebl, idx), cnt / elsize,
2476 idx, section_name (ebl, idx),
2477 val, section_name (ebl, val));
2482 idx, section_name (ebl, idx), cnt / elsize,
2483 val, section_name (ebl, val));
2489 val, section_name (ebl, val));
2551 has_copy_reloc (Ebl *ebl, unsigned int symscnndx, unsigned int symndx)
2557 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
2583 && ebl_copy_reloc_p (ebl, GELF_R_TYPE (rel->r_info)))
2595 && ebl_copy_reloc_p (ebl, GELF_R_TYPE (rela->r_info)))
2604 in_nobits_scn (Ebl *ebl, unsigned int shndx)
2607 GElf_Shdr *shdr = gelf_getshdr (elf_getscn (ebl->elf, shndx), &shdr_mem);
2650 check_versym (Ebl *ebl, int idx)
2652 Elf_Scn *scn = elf_getscn (ebl->elf, idx);
2663 idx, section_name (ebl, idx));
2667 Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link);
2678 idx, section_name (ebl, idx),
2679 shdr->sh_link, section_name (ebl, shdr->sh_link));
2689 idx, section_name (ebl, idx),
2690 shdr->sh_link, section_name (ebl, shdr->sh_link));
2705 idx, section_name (ebl, idx), cnt);
2721 idx, section_name (ebl, idx), cnt);
2729 idx, section_name (ebl, idx), cnt);
2743 idx, section_name (ebl, idx), cnt, (int) *versym);
2748 idx, section_name (ebl, idx), cnt, (int) *versym);
2754 if (!has_copy_reloc (ebl, shdr->sh_link, cnt)
2755 && !in_nobits_scn (ebl, sym->st_shndx))
2758 idx, section_name (ebl, idx), cnt, (int) *versym);
2805 check_verneed (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
2811 GElf_Shdr *strshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
2818 idx, section_name (ebl, idx));
2820 Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
2824 idx, section_name (ebl, idx));
2841 idx, section_name (ebl, idx), cnt, (int) need->vn_version);
2843 if (need->vn_cnt > 0 && need->vn_aux < gelf_fsize (ebl->elf, ELF_T_VNEED,
2847 idx, section_name (ebl, idx), cnt);
2849 const char *libname = elf_strptr (ebl->elf, shdr->sh_link,
2855 idx, section_name (ebl, idx), cnt);
2860 if (unknown_dependency_p (ebl->elf, ehdr, libname))
2863 idx, section_name (ebl, idx), cnt);
2875 idx, section_name (ebl, idx), need->vn_cnt - cnt2, cnt);
2877 const char *verstr = elf_strptr (ebl->elf, shdr->sh_link,
2882 idx, section_name (ebl, idx), need->vn_cnt - cnt2, cnt);
2889 idx, section_name (ebl, idx), need->vn_cnt - cnt2,
2899 idx, section_name (ebl, idx), need->vn_cnt - cnt2,
2905 && aux->vna_next < gelf_fsize (ebl->elf, ELF_T_VNAUX, 1,
2910 idx, section_name (ebl, idx), need->vn_cnt - cnt2, cnt);
2915 gelf_fsize (ebl->elf, ELF_T_VNAUX, 1, EV_CURRENT));
2926 idx, section_name (ebl, idx), cnt);
2934 check_verdef (Ebl *ebl, GElf_Shdr *shdr, int idx)
2940 GElf_Shdr *strshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
2947 idx, section_name (ebl, idx));
2949 Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
2954 idx, section_name (ebl, idx));
2984 idx, section_name (ebl, idx));
2988 idx, section_name (ebl, idx));
2994 idx, section_name (ebl, idx), cnt);
2999 idx, section_name (ebl, idx), cnt, (int) def->vd_version);
3001 if (def->vd_cnt > 0 && def->vd_aux < gelf_fsize (ebl->elf, ELF_T_VDEF,
3005 idx, section_name (ebl, idx), cnt);
3013 const char *name = elf_strptr (ebl->elf, shdr->sh_link, aux->vda_name);
3018 idx, section_name (ebl, idx), cnt);
3025 idx, section_name (ebl, idx), cnt, (int) hashval,
3034 idx, section_name (ebl, idx), cnt, name);
3049 name = elf_strptr (ebl->elf, shdr->sh_link, aux->vda_name);
3053 idx, section_name (ebl, idx), cnt);
3063 && aux->vda_next < gelf_fsize (ebl->elf, ELF_T_VDAUX, 1,
3068 idx, section_name (ebl, idx), cnt);
3073 gelf_fsize (ebl->elf, ELF_T_VDAUX, 1, EV_CURRENT));
3084 idx, section_name (ebl, idx), cnt);
3089 idx, section_name (ebl, idx));
3106 idx, section_name (ebl, idx), namelist->name);
3113 check_attributes (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
3118 idx, section_name (ebl, idx));
3122 Elf_Data *data = elf_rawdata (elf_getscn (ebl->elf, idx), NULL);
3126 idx, section_name (ebl, idx));
3139 idx, section_name (ebl, idx));
3156 idx, section_name (ebl, idx), pos (p));
3165 idx, section_name (ebl, idx), pos (p));
3177 idx, section_name (ebl, idx), pos (p));
3194 idx, section_name (ebl, idx), pos (chunk));
3203 idx, section_name (ebl, idx), pos (q));
3212 idx, section_name (ebl, idx), pos (q));
3225 idx, section_name (ebl, idx), pos (q));
3236 idx, section_name (ebl, idx), pos (chunk), subsection_tag);
3254 idx, section_name (ebl, idx), pos (chunk));
3265 idx, section_name (ebl, idx), pos (chunk));
3273 if (!ebl_check_object_attribute (ebl, (const char *) name,
3278 idx, section_name (ebl, idx), pos (chunk), tag);
3282 idx, section_name (ebl, idx), pos (chunk),
3292 idx, section_name (ebl, idx), pos (p), name);
3298 idx, section_name (ebl, idx), pos (p));
3363 check_sections (Ebl *ebl, GElf_Ehdr *ehdr)
3376 GElf_Shdr *shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem);
3417 shdr = gelf_getshdr (elf_getscn (ebl->elf, cnt), &shdr_mem);
3422 cnt, section_name (ebl, cnt), elf_errmsg (-1));
3426 const char *scnname = elf_strptr (ebl->elf, shstrndx, shdr->sh_name);
3445 && ebl_bss_plt_p (ebl, ehdr))
3459 ebl_section_type_name (ebl, special_sections[s].type,
3461 ebl_section_type_name (ebl, shdr->sh_type,
3563 cnt, section_name (ebl, cnt));
3565 if (elf_strptr (ebl->elf, shstrndx, shdr->sh_name) == NULL)
3575 && ebl_section_type_name (ebl, shdr->sh_type, NULL, 0) == NULL)
3577 cnt, section_name (ebl, cnt),
3588 if (!ebl_machine_section_flag_check (ebl,
3593 cnt, section_name (ebl, cnt), sh_flags & SHF_MASKPROC);
3599 cnt, section_name (ebl, cnt), sh_flags);
3607 cnt, section_name (ebl, cnt));
3615 cnt, section_name (ebl, cnt));
3620 cnt, section_name (ebl, cnt));
3627 cnt, section_name (ebl, cnt));
3632 cnt, section_name (ebl, cnt));
3635 check_scn_group (ebl, cnt);
3650 cnt, section_name (ebl, cnt), shdr->sh_type);
3655 && !ebl_check_special_section (ebl, cnt, shdr,
3656 section_name (ebl, cnt)))
3659 cnt, section_name (ebl, cnt));
3671 if ((phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem)) != NULL
3686 cnt, section_name (ebl, cnt), pcnt);
3694 cnt, section_name (ebl, cnt), pcnt);
3703 cnt, section_name (ebl, cnt), pcnt);
3714 cnt, section_name (ebl, cnt), pcnt);
3724 cnt, section_name (ebl, cnt), pcnt);
3734 cnt, section_name (ebl, cnt));
3740 cnt, section_name (ebl, cnt));
3748 cnt, section_name (ebl, cnt));
3751 check_symtab (ebl, ehdr, shdr, cnt);
3755 check_rela (ebl, ehdr, shdr, cnt);
3759 check_rel (ebl, ehdr, shdr, cnt);
3763 check_dynamic (ebl, ehdr, shdr, cnt);
3767 check_symtab_shndx (ebl, ehdr, shdr, cnt);
3771 check_hash (shdr->sh_type, ebl, ehdr, shdr, cnt);
3776 check_hash (shdr->sh_type, ebl, ehdr, shdr, cnt);
3781 check_null (ebl, shdr, cnt);
3785 check_group (ebl, ehdr, shdr, cnt);
3789 check_note_section (ebl, ehdr, shdr, cnt);
3802 check_verneed (ebl, ehdr, shdr, cnt);
3806 check_verdef (ebl, shdr, cnt);
3810 check_attributes (ebl, ehdr, shdr, cnt);
3826 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, pcnt, &phdr_mem);
3851 check_versym (ebl, versym_scnndx);
3879 compare_hash_gnu_hash (ebl, ehdr, hash_idx, gnu_hash_idx);
3886 check_note_data (Ebl *ebl, const GElf_Ehdr *ehdr,
3931 shndx, section_name (ebl, shndx),
3957 shndx, section_name (ebl, shndx),
3966 check_note (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Phdr *phdr, int cnt)
3982 Elf_Data *data = elf_getdata_rawchunk (ebl->elf,
3986 notes_size = check_note_data (ebl, ehdr, data, 0, cnt, phdr->p_offset);
3997 check_note_section (Ebl *ebl, GElf_Ehdr *ehdr, GElf_Shdr *shdr, int idx)
4002 Elf_Data *data = elf_getdata (elf_getscn (ebl->elf, idx), NULL);
4006 idx, section_name (ebl, idx));
4014 idx, section_name (ebl, idx));
4016 GElf_Off notes_size = check_note_data (ebl, ehdr, data, idx, 0, 0);
4020 idx, section_name (ebl, idx));
4024 idx, section_name (ebl, idx), shdr->sh_size - notes_size);
4028 check_program_header (Ebl *ebl, GElf_Ehdr *ehdr)
4047 phdr = gelf_getphdr (ebl->elf, cnt, &phdr_mem);
4058 && ebl_segment_type_name (ebl, phdr->p_type, NULL, 0) == NULL)
4081 check_note (ebl, ehdr, phdr, cnt);
4092 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
4123 phdr2 = gelf_getphdr (ebl->elf, inner, &phdr2_mem);
4157 phdr2 = gelf_getphdr (ebl->elf, inner, &phdr2_mem);
4212 Ebl *ebl;
4229 ebl = ebl_openbackend (elf);
4235 check_elf_header (ebl, ehdr, size);
4238 check_program_header (ebl, ehdr);
4242 check_sections (ebl, ehdr);
4249 ebl_closebackend (ebl);