Lines Matching refs:ebl

158 static void print_ehdr (Ebl *ebl, GElf_Ehdr *ehdr);
159 static void print_shdr (Ebl *ebl, GElf_Ehdr *ehdr);
160 static void print_phdr (Ebl *ebl, GElf_Ehdr *ehdr);
161 static void print_scngrp (Ebl *ebl, GElf_Ehdr *ehdr);
162 static void print_dynamic (Ebl *ebl, GElf_Ehdr *ehdr);
163 static void print_relocs (Ebl *ebl, GElf_Ehdr *ehdr);
164 static void handle_relocs_rel (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
166 static void handle_relocs_rela (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
168 static void print_symtab (Ebl *ebl, GElf_Ehdr *ehdr, int type);
169 static void handle_symtab (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
171 static void print_verinfo (Ebl *ebl, GElf_Ehdr *ehdr);
172 static void handle_verneed (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
174 static void handle_verdef (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
176 static void handle_versym (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
178 static void print_debug (Ebl *ebl, GElf_Ehdr *ehdr);
179 static void handle_hash (Ebl *ebl, GElf_Ehdr *ehdr);
180 static void handle_notes (Ebl *ebl, GElf_Ehdr *ehdr);
181 static void print_liblist (Ebl *ebl, GElf_Ehdr *ehdr);
463 Ebl *ebl;
480 ebl = ebl_openbackend (elf);
481 if (ebl == NULL)
488 if (elf_getshnum (ebl->elf, &shnum) < 0)
494 print_ehdr (ebl, ehdr);
496 print_shdr (ebl, ehdr);
498 print_phdr (ebl, ehdr);
500 print_scngrp (ebl, ehdr);
502 print_dynamic (ebl, ehdr);
504 print_relocs (ebl, ehdr);
506 handle_hash (ebl, ehdr);
508 print_symtab (ebl, ehdr, SHT_DYNSYM);
510 print_verinfo (ebl, ehdr);
512 print_symtab (ebl, ehdr, SHT_SYMTAB);
514 print_liblist (ebl, ehdr);
516 print_debug (ebl, ehdr);
518 handle_notes (ebl, ehdr);
520 ebl_closebackend (ebl);
551 print_ehdr (Ebl *ebl, GElf_Ehdr *ehdr)
577 ebl_osabi_name (ebl, ehdr->e_ident[EI_OSABI], buf, sizeof (buf)));
585 printf (gettext (" Machine: %s\n"), ebl->name);
601 ebl_machine_flag_name (ebl, ehdr->e_flags, buf, sizeof (buf)));
622 shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem);
636 shdr = gelf_getshdr (elf_getscn (ebl->elf, 0), &shdr_mem);
677 print_shdr (Ebl *ebl, GElf_Ehdr *ehdr)
689 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
705 Elf_Scn *scn = elf_getscn (ebl->elf, cnt);
750 elf_strptr (ebl->elf, shstrndx, shdr->sh_name)
752 ebl_section_type_name (ebl, shdr->sh_type, buf, sizeof (buf)),
766 print_phdr (Ebl *ebl, GElf_Ehdr *ehdr)
791 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, cnt, &mem);
802 ebl_segment_type_name (ebl, phdr->p_type, buf, sizeof (buf)),
817 char *filedata = elf_rawfile (ebl->elf, &maxsize);
832 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
841 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, cnt, &phdr_mem);
856 Elf_Scn *scn = elf_getscn (ebl->elf, inner);
900 elf_strptr (ebl->elf, shstrndx, shdr->sh_name));
921 handle_scngrp (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
936 symscn = elf_getscn (ebl->elf, shdr->sh_link);
945 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
962 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
963 elf_strptr (ebl->elf, symshdr->sh_link,
973 grpshdr = gelf_getshdr (elf_getscn (ebl->elf, grpref[cnt]),
981 elf_strptr (ebl->elf, shstrndx, grpshdr->sh_name)
988 print_scngrp (Ebl *ebl, GElf_Ehdr *ehdr)
993 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
1000 handle_scngrp (ebl, ehdr, scn, shdr);
1115 handle_dynamic (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
1117 int class = gelf_getclass (ebl->elf);
1129 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
1142 elf_strptr (ebl->elf, shstrndx,
1143 gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1158 ebl_dynamic_tag_name (ebl, dyn->d_tag, buf, sizeof (buf)));
1172 elf_strptr (ebl->elf, shdr->sh_link, dyn->d_un.d_val));
1177 elf_strptr (ebl->elf, shdr->sh_link, dyn->d_un.d_val));
1182 elf_strptr (ebl->elf, shdr->sh_link, dyn->d_un.d_val));
1187 elf_strptr (ebl->elf, shdr->sh_link, dyn->d_un.d_val));
1217 puts (ebl_dynamic_tag_name (ebl, dyn->d_un.d_val, NULL, 0));
1247 print_dynamic (Ebl *ebl, GElf_Ehdr *ehdr)
1252 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
1260 handle_dynamic (ebl, ehdr, scn, shdr);
1269 print_relocs (Ebl *ebl, GElf_Ehdr *ehdr)
1274 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
1283 handle_relocs_rel (ebl, ehdr, scn, shdr);
1285 handle_relocs_rela (ebl, ehdr, scn, shdr);
1293 handle_relocs_rel (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
1295 int class = gelf_getclass (ebl->elf);
1315 symscn = elf_getscn (ebl->elf, shdr->sh_link);
1320 destshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_info),
1332 while ((xndxscn = elf_nextscn (ebl->elf, xndxscn)) != NULL)
1348 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
1359 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
1361 elf_strptr (ebl->elf, shstrndx, destshdr->sh_name),
1374 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
1402 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1405 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1413 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1416 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1420 elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name));
1423 destshdr = gelf_getshdr (elf_getscn (ebl->elf,
1431 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1434 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1443 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1446 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1450 elf_strptr (ebl->elf, shstrndx, destshdr->sh_name));
1459 handle_relocs_rela (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
1461 int class = gelf_getclass (ebl->elf);
1470 Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link);
1477 GElf_Shdr *destshdr = gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_info),
1490 while ((xndxscn = elf_nextscn (ebl->elf, xndxscn)) != NULL)
1507 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
1517 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
1519 elf_strptr (ebl->elf, shstrndx, destshdr->sh_name),
1546 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1549 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1558 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1561 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1566 elf_strptr (ebl->elf, symshdr->sh_link, sym->st_name));
1569 destshdr = gelf_getshdr (elf_getscn (ebl->elf,
1577 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1580 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1590 ebl_reloc_type_check (ebl, GELF_R_TYPE (rel->r_info))
1593 ? ebl_reloc_type_name (ebl, GELF_R_TYPE (rel->r_info),
1598 elf_strptr (ebl->elf, shstrndx, destshdr->sh_name));
1607 print_symtab (Ebl *ebl, GElf_Ehdr *ehdr, int type)
1613 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
1620 handle_symtab (ebl, ehdr, scn, shdr);
1626 handle_symtab (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
1634 int class = gelf_getclass (ebl->elf);
1649 while ((runscn = elf_nextscn (ebl->elf, runscn)) != NULL)
1680 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
1692 elf_strptr (ebl->elf, shstrndx, shdr->sh_name), nsyms);
1698 elf_strptr (ebl->elf, shstrndx,
1699 gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1731 ebl_symbol_type_name (ebl, GELF_ST_TYPE (sym->st_info),
1733 ebl_symbol_binding_name (ebl, GELF_ST_BIND (sym->st_info),
1736 ebl_section_name (ebl, sym->st_shndx, xndx, scnbuf,
1738 elf_strptr (ebl->elf, shdr->sh_link, sym->st_name));
1757 gelf_getshdr (elf_getscn (ebl->elf, xndx), &symshdr_mem);
1809 elf_strptr (ebl->elf, verneed_stridx,
1852 elf_strptr (ebl->elf, verdef_stridx,
1866 print_verinfo (Ebl *ebl, GElf_Ehdr *ehdr)
1872 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
1881 handle_verneed (ebl, ehdr, scn, shdr);
1883 handle_verdef (ebl, ehdr, scn, shdr);
1885 handle_versym (ebl, ehdr, scn, shdr);
1924 handle_verneed (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
1927 int class = gelf_getclass (ebl->elf);
1939 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
1949 elf_strptr (ebl->elf, shstrndx, shdr->sh_name), shdr->sh_info,
1953 elf_strptr (ebl->elf, shstrndx,
1954 gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
1972 elf_strptr (ebl->elf, shdr->sh_link, need->vn_file),
1987 elf_strptr (ebl->elf, shdr->sh_link, aux->vna_name),
2001 handle_verdef (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
2004 int class = gelf_getclass (ebl->elf);
2016 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
2026 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
2031 elf_strptr (ebl->elf, shstrndx,
2032 gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
2061 elf_strptr (ebl->elf, shdr->sh_link, aux->vda_name));
2072 elf_strptr (ebl->elf, shdr->sh_link, aux->vda_name));
2084 handle_versym (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn, GElf_Shdr *shdr)
2087 int class = gelf_getclass (ebl->elf);
2104 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
2114 while ((verscn = elf_nextscn (ebl->elf, verscn)) != NULL)
2255 = elf_strptr (ebl->elf, defshdr->sh_link, aux->vda_name);
2300 = elf_strptr (ebl->elf, needshdr->sh_link, aux->vna_name);
2302 = elf_strptr (ebl->elf, needshdr->sh_link, need->vn_file);
2325 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
2330 elf_strptr (ebl->elf, shstrndx,
2331 gelf_getshdr (elf_getscn (ebl->elf, shdr->sh_link),
2377 handle_hash (Ebl *ebl, GElf_Ehdr *ehdr)
2385 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
2389 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
2428 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
2430 gelf_getclass (ebl->elf) == ELFCLASS32 ? 10 : 18,
2434 elf_strptr (ebl->elf, shstrndx,
2435 gelf_getshdr (elf_getscn (ebl->elf,
2503 print_liblist (Ebl *ebl, GElf_Ehdr *ehdr)
2511 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
2515 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
2529 elf_strptr (ebl->elf, shstrndx, shdr->sh_name),
2553 cnt, elf_strptr (ebl->elf, shdr->sh_link, lib->l_name),
3252 print_debug_abbrev_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
3309 print_debug_aranges_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
3363 print_debug_frame_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
3503 print_debug_info_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
3706 print_debug_line_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
3870 = elf_getident (ebl->elf, NULL)[EI_CLASS] == ELFCLASS32 ? 4 : 8;
4117 print_debug_loc_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
4152 print_debug_macinfo_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
4321 print_debug_pubnames_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
4333 print_debug_str_section (Ebl *ebl, GElf_Ehdr *ehdr, Elf_Scn *scn,
4372 print_debug (Ebl *ebl, GElf_Ehdr *ehdr)
4381 dbg = dwarf_begin_elf (ebl->elf, DWARF_C_READ, NULL);
4390 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
4395 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
4425 const char *name = elf_strptr (ebl->elf, shstrndx,
4433 debug_sections[n].fp (ebl, ehdr, scn, shdr, dbg);
4445 handle_notes (Ebl *ebl, GElf_Ehdr *ehdr)
4447 int class = gelf_getclass (ebl->elf);
4455 GElf_Phdr *phdr = gelf_getphdr (ebl->elf, cnt, &mem);
4465 char *notemem = gelf_rawchunk (ebl->elf, phdr->p_offset, phdr->p_filesz);
4514 ? ebl_core_note_type_name (ebl, noteentry->type,
4516 : ebl_object_note_type_name (ebl, noteentry->type,
4525 ebl_core_note (ebl, noteentry->name, noteentry->type,
4529 ebl_object_note (ebl, noteentry->name, noteentry->type,
4539 gelf_freechunk (ebl->elf, notemem);