Home | History | Annotate | Download | only in src

Lines Matching defs:ebl

206 static void print_ehdr (Ebl *ebl, GElf_Ehdr *ehdr);
207 static void print_shdr (Ebl *ebl, GElf_Ehdr *ehdr);
208 static void print_phdr (Ebl *ebl, GElf_Ehdr *ehdr);
209 static void print_scngrp (Ebl *ebl);
210 static void print_dynamic (Ebl *ebl, GElf_Ehdr *ehdr);
211 static void print_relocs (Ebl *ebl);
212 static void handle_relocs_rel (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr);
213 static void handle_relocs_rela (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr);
214 static void print_symtab (Ebl *ebl, int type);
215 static void handle_symtab (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr);
216 static void print_verinfo (Ebl *ebl);
217 static void handle_verneed (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr);
218 static void handle_verdef (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr);
219 static void handle_versym (Ebl *ebl, Elf_Scn *scn,
221 static void print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr);
222 static void handle_hash (Ebl *ebl);
223 static void handle_notes (Ebl *ebl, GElf_Ehdr *ehdr);
224 static void print_liblist (Ebl *ebl);
225 static void print_attributes (Ebl *ebl, const GElf_Ehdr *ehdr);
226 static void dump_data (Ebl *ebl);
227 static void dump_strings (Ebl *ebl);
228 static void print_strings (Ebl *ebl);
584 Ebl *ebl = ebl_openbackend (elf);
585 if (unlikely (ebl == NULL))
588 error (0, errno, gettext ("cannot create EBL handle"));
593 if (unlikely (elf_getshnum (ebl->elf, &shnum) < 0))
607 Ebl *pure_ebl = ebl;
629 print_ehdr (ebl, ehdr);
633 print_phdr (ebl, ehdr);
635 print_scngrp (ebl);
637 print_dynamic (ebl, ehdr);
641 handle_hash (ebl);
643 print_symtab (ebl, SHT_DYNSYM);
645 print_verinfo (ebl);
647 print_symtab (ebl, SHT_SYMTAB);
649 print_liblist (ebl);
651 print_attributes (ebl, ehdr);
655 dump_strings (ebl);
657 print_debug (dwflmod, ebl, ehdr);
661 print_strings (ebl);
663 ebl_closebackend (ebl);
665 if (pure_ebl != ebl)
700 print_ehdr (Ebl *ebl, GElf_Ehdr *ehdr)
724 ebl_osabi_name (ebl, ehdr->e_ident[EI_OSABI], buf, sizeof (buf)));
732 printf (gettext (" Machine: %s\n"), ebl->name);
748 ebl_machine_flag_name (ebl, ehdr->e_flags, buf, sizeof (buf)));
767 GElf_Shdr *shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem);
779 GElf_Shdr *shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem);
820 print_shdr (Ebl *ebl, GElf_Ehdr *ehdr)
832 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
845 Elf_Scn *scn = elf_getscn (ebl->elf, cnt);
891 elf_strptr (ebl->elf, shstrndx, shdr->sh_name)
893 ebl_section_type_name (ebl, shdr->sh_type, buf, sizeof (buf)),
907 print_phdr (Ebl *ebl, GElf_Ehdr *ehdr)
929 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, cnt, &mem);
940 ebl_segment_type_name (ebl, phdr->p_type, buf, sizeof (buf)),
955 char *filedata = elf_rawfile (ebl->elf, &maxsize);
971 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
983 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, cnt, &phdr_mem);
994 Elf_Scn *scn = elf_getscn (ebl->elf, inner);
1050 phdr2 = gelf_getphdr (ebl->elf, cnt2, &phdr2_mem);
1075 elf_strptr (ebl->elf, shstrndx, shdr->sh_name));
1096 handle_scngrp (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
1101 Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link);
1112 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
1130 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
1131 elf_strptr (ebl->elf, symshdr->sh_link,
1139 GElf_Shdr *grpshdr = gelf_getshdr (elf_getscn (ebl->elf, grpref[cnt]),
1146 && (str = elf_strptr (ebl->elf, shstrndx, grpshdr->sh_name))
1153 print_scngrp (Ebl *ebl)
1158 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
1165 handle_scngrp (ebl, scn, shdr);
1280 handle_dynamic (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
1282 int class = gelf_getclass (ebl->elf);
1294 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
1307 elf_strptr (ebl->elf, shstrndx,
1308 gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1321 ebl_dynamic_tag_name (ebl, dyn->d_tag, buf, sizeof (buf)));
1335 elf_strptr (ebl->elf, shdr->sh_link, dyn->d_un.d_val));
1340 elf_strptr (ebl->elf, shdr->sh_link, dyn->d_un.d_val));
1345 elf_strptr (ebl->elf, shdr->sh_link, dyn->d_un.d_val));
1350 elf_strptr (ebl->elf, shdr->sh_link, dyn->d_un.d_val));
1380 puts (ebl_dynamic_tag_name (ebl, dyn->d_un.d_val, NULL, 0));
1410 print_dynamic (Ebl *ebl, GElf_Ehdr *ehdr)
1415 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, i, &phdr_mem);
1419 Elf_Scn *scn = gelf_offscn (ebl->elf, phdr->p_offset);
1423 handle_dynamic (ebl, scn, shdr);
1432 print_relocs (Ebl *ebl)
1437 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
1446 handle_relocs_rel (ebl, scn, shdr);
1448 handle_relocs_rela (ebl, scn, shdr);
1456 handle_relocs_rel (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
1458 int class = gelf_getclass (ebl->elf);
1467 Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link);
1474 GElf_Shdr *destshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_info),
1488 xndxdata = elf_getdata (elf_getscn (ebl->elf, xndxscnidx), NULL);
1492 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
1503 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
1505 elf_strptr (ebl->elf, shstrndx, destshdr->sh_name),
1518 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
1543 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1546 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1554 likely (ebl_reloc_type_check (ebl,
1558 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1562 elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name));
1565 destshdr = gelf_getshdr (elf_getscn (ebl->elf,
1573 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1576 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1585 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1588 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1592 elf_strptr (ebl->elf, shstrndx, destshdr->sh_name));
1601 handle_relocs_rela (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
1603 int class = gelf_getclass (ebl->elf);
1612 Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link);
1619 GElf_Shdr *destshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_info),
1633 xndxdata = elf_getdata (elf_getscn (ebl->elf, xndxscnidx), NULL);
1637 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
1647 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
1649 elf_strptr (ebl->elf, shstrndx, destshdr->sh_name),
1675 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1678 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1687 likely (ebl_reloc_type_check (ebl,
1691 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1696 elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name));
1699 destshdr = gelf_getshdr (elf_getscn (ebl->elf,
1707 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1710 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1720 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1723 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1728 elf_strptr (ebl->elf, shstrndx, destshdr->sh_name));
1737 print_symtab (Ebl *ebl, int type)
1743 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
1750 handle_symtab (ebl, scn, shdr);
1756 handle_symtab (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
1762 int class = gelf_getclass (ebl->elf);
1773 while ((runscn = elf_nextscn (ebl->elf, runscn)) != NULL)
1805 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
1818 elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms);
1825 elf_strptr (ebl->elf, shstrndx,
1826 gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1858 ebl_symbol_type_name (ebl, GELF_ST_TYPE (sym->st_info),
1860 ebl_symbol_binding_name (ebl, GELF_ST_BIND (sym->st_info),
1863 ebl_section_name (ebl, sym->st_shndx, xndx, scnbuf,
1865 elf_strptr (ebl->elf, shdr->sh_link, sym->st_name));
1882 gelf_getshdr (elf_getscn (ebl->elf, xndx), &symshdr_mem);
1934 elf_strptr (ebl->elf, verneed_stridx,
1976 elf_strptr (ebl->elf, verdef_stridx,
1990 print_verinfo (Ebl *ebl)
1996 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
2005 handle_verneed (ebl, scn, shdr);
2007 handle_verdef (ebl, scn, shdr);
2009 handle_versym (ebl, scn, shdr);
2048 handle_verneed (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
2050 int class = gelf_getclass (ebl->elf);
2059 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
2070 elf_strptr (ebl->elf, shstrndx, shdr->sh_name), shdr->sh_info,
2074 elf_strptr (ebl->elf, shstrndx,
2075 gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
2089 elf_strptr (ebl->elf, shdr->sh_link, need->vn_file),
2102 elf_strptr (ebl->elf, shdr->sh_link, aux->vna_name),
2116 handle_verdef (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
2125 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
2129 int class = gelf_getclass (ebl->elf);
2137 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
2142 elf_strptr (ebl->elf, shstrndx,
2143 gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
2167 elf_strptr (ebl->elf, shdr->sh_link, aux->vda_name));
2178 elf_strptr (ebl->elf, shdr->sh_link, aux->vda_name));
2190 handle_versym (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr)
2192 int class = gelf_getclass (ebl->elf);
2203 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
2213 ebl->elf, verscn)) != NULL)
2352 = elf_strptr (ebl->elf, defshdr->sh_link, aux->vda_name);
2388 = elf_strptr (ebl->elf, needshdr->sh_link, aux->vna_name);
2390 = elf_strptr (ebl->elf, needshdr->sh_link, need->vn_file);
2414 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
2419 elf_strptr (ebl->elf, shstrndx,
2420 gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
2464 print_hash_info (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr, size_t shstrndx,
2480 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
2482 gelf_getclass (ebl->elf) == ELFCLASS32 ? 10 : 18,
2486 elf_strptr (ebl->elf, shstrndx,
2487 gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
2532 handle_sysv_hash (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr, size_t shstrndx)
2564 print_hash_info (ebl, scn, shdr, shstrndx, maxlength, nbucket, nsyms,
2574 handle_sysv_hash64 (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr, size_t shstrndx)
2606 print_hash_info (ebl, scn, shdr, shstrndx, maxlength, nbucket, nsyms,
2615 handle_gnu_hash (Ebl *ebl, Elf_Scn *scn, GElf_Shdr *shdr, size_t shstrndx)
2632 if (gelf_getclass (ebl->elf) == ELFCLASS64)
2685 print_hash_info (ebl, scn, shdr, shstrndx, maxlength, nbucket, nsyms,
2696 handle_hash (Ebl *ebl)
2700 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
2705 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
2715 if (ebl_sysvhash_entrysize (ebl) == sizeof (Elf64_Xword))
2716 handle_sysv_hash64 (ebl, scn, shdr, shstrndx);
2718 handle_sysv_hash (ebl, scn, shdr, shstrndx);
2721 handle_gnu_hash (ebl, scn, shdr, shstrndx);
2728 print_liblist (Ebl *ebl)
2736 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
2740 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
2754 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
2778 cnt, elf_strptr (ebl->elf, shdr->sh_link, lib->l_name),
2790 print_attributes (Ebl *ebl, const GElf_Ehdr *ehdr)
2798 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
2802 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
2814 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
2916 ebl_check_object_attribute (ebl, (const char *) name,
3961 Ebl *ebl __attribute__ ((unused)),
4033 Ebl *ebl __attribute__ ((unused)),
4090 Ebl *ebl __attribute__ ((unused)),
4164 Ebl *ebl __attribute__ ((unused)),
4390 Ebl *ebl __attribute__ ((unused)),
4512 print_debug_line_section (Dwfl_Module *dwflmod, Ebl *ebl,
4687 = elf_getident (ebl->elf, NULL)[EI_CLASS] == ELFCLASS32 ? 4 : 8;
4949 Ebl *ebl __attribute__ ((unused)),
5055 Ebl *ebl __attribute__ ((unused)),
5227 Ebl *ebl __attribute__ ((unused)),
5242 Ebl *ebl __attribute__ ((unused)),
5282 print_debug (Dwfl_Module *dwflmod, Ebl *ebl, GElf_Ehdr *ehdr)
5296 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
5302 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
5313 void (*fp) (Dwfl_Module *, Ebl *,
5333 const char *name = elf_strptr (ebl->elf, shstrndx,
5341 debug_sections[n].fp (dwflmod, ebl, ehdr, scn, shdr, dbg);
5746 handle_core_register (Ebl *ebl, Elf *core, int maxregname,
5762 ssize_t n = ebl_register_info (ebl, reg, name, sizeof name,
5904 handle_core_registers (Ebl *ebl, Elf *core, const void *desc,
5910 ssize_t maxnreg = ebl_register_info (ebl, 0, NULL, 0, NULL, NULL, NULL, NULL);
5933 ssize_t n = ebl_register_info (ebl, reg, info->name, sizeof info->name,
5980 colno = handle_core_register (ebl, core, maxname,
5991 handle_auxv_note (Ebl *ebl, Elf *core, GElf_Word descsz, GElf_Off desc_pos)
6009 if (ebl_auxv_info (ebl, av->a_type, &name, &fmt) == 0)
6063 handle_core_note (Ebl *ebl, const GElf_Nhdr *nhdr, const void *desc)
6071 if (! ebl_core_note (ebl, nhdr->n_type, nhdr->n_descsz,
6079 unsigned int colno = handle_core_items (ebl->elf, desc,
6085 colno = handle_core_registers (ebl, ebl->elf, desc + regs_offset,
6092 handle_notes_data (Ebl *ebl, const GElf_Ehdr *ehdr,
6116 ? ebl_core_note_type_name (ebl, nhdr.n_type,
6118 : ebl_object_note_type_name (ebl, nhdr.n_type,
6129 handle_auxv_note (ebl, ebl->elf, nhdr.n_descsz,
6132 handle_core_note (ebl, &nhdr, desc);
6135 ebl_object_note (ebl, name, nhdr.n_type, nhdr.n_descsz, desc);
6149 handle_notes (Ebl *ebl, GElf_Ehdr *ehdr)
6157 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
6162 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
6174 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
6177 handle_notes_data (ebl, ehdr, shdr->sh_offset,
6188 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, cnt, &mem);
6198 handle_notes_data (ebl, ehdr, phdr->p_offset,
6199 elf_getdata_rawchunk (ebl->elf,
6355 dump_data (Ebl *ebl)
6357 for_each_section_argument (ebl->elf, dump_data_sections, &dump_data_section);
6361 dump_strings (Ebl *ebl)
6363 for_each_section_argument (ebl->elf, string_sections, &print_string_section);
6367 print_strings (Ebl *ebl)
6371 if (unlikely (elf_getshstrndx (ebl->elf, &shstrndx) < 0))
6379 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
6388 name = elf_strptr (ebl->elf, shstrndx, shdr_mem.sh_name);