Home | History | Annotate | Download | only in src

Lines Matching refs:Elf

1 /* Print size information from ELF file.
108 static int handle_ar (int fd, Elf *elf, const char *prefix, const char *fname);
110 /* Handle ELF file. */
111 static void handle_elf (Elf *elf, const char *fullname, const char *fname);
161 "class" of ELF binaries processed. */
305 /* Now get the ELF descriptor. */
306 Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
307 if (likely (elf != NULL))
309 if (elf_kind (elf) == ELF_K_ELF)
311 handle_elf (elf, NULL, fname);
313 if (unlikely (elf_end (elf) != 0))
321 else if (likely (elf_kind (elf) == ELF_K_AR))
322 return handle_ar (fd, elf, NULL, fname);
325 if (unlikely (elf_end (elf) != 0))
337 print_header (Elf *elf)
343 int ddigits = length_map[gelf_getclass (elf) - 1][radix_decimal];
344 int xdigits = length_map[gelf_getclass (elf) - 1][radix_hex];
360 handle_ar (int fd, Elf *elf, const char *prefix, const char *fname)
377 Elf *subelf;
379 while ((subelf = elf_begin (fd, cmd, elf)) != NULL)
396 if (unlikely (elf_end (elf) != 0))
408 show_sysv (Elf *elf, const char *prefix, const char *fname,
412 const int digits = length_map[gelf_getclass (elf) - 1][radix];
416 if (unlikely (elf_getshstrndx (elf, &shstrndx) < 0))
422 while ((scn = elf_nextscn (elf, scn)) != NULL)
433 (int) strlen (elf_strptr (elf, shstrndx,
455 while ((scn = elf_nextscn (elf, scn)) != NULL)
464 maxlen, elf_strptr (elf, shstrndx, shdr->sh_name),
486 show_sysv_one_line (Elf *elf)
490 if (unlikely (elf_getshstrndx (elf, &shstrndx) < 0))
506 while ((scn = elf_nextscn (elf, scn)) != NULL)
520 elf_strptr (elf, shstrndx, shdr->sh_name));
542 show_bsd (Elf *elf, const char *prefix, const char *fname,
548 const int ddigits = length_map[gelf_getclass (elf) - 1][radix_decimal];
549 const int xdigits = length_map[gelf_getclass (elf) - 1][radix_hex];
553 while ((scn = elf_nextscn (elf, scn)) != NULL)
589 totals_class = MAX (totals_class, gelf_getclass (elf));
613 show_segments (Elf *elf, const char *fullname)
616 GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
627 phdr = gelf_getphdr (elf, cnt, &phdr_mem);
660 handle_elf (Elf *elf, const char *prefix, const char *fname)
676 show_sysv (elf, prefix, fname, fullname);
678 show_sysv_one_line (elf);
680 show_segments (elf, fullname);
683 print_header (elf);
685 show_bsd (elf, prefix, fname, fullname);