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