Lines Matching defs:elf

95 static int handle_ar (int fd, Elf *elf, const char *prefix, const char *fname);
98 static void handle_elf (Elf *elf, const char *fullname, const char *fname);
276 Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
277 if (likely (elf != NULL))
279 if (elf_kind (elf) == ELF_K_ELF)
281 handle_elf (elf, NULL, fname);
283 if (unlikely (elf_end (elf) != 0))
291 else if (likely (elf_kind (elf) == ELF_K_AR))
293 int result = handle_ar (fd, elf, NULL, fname);
302 if (unlikely (elf_end (elf) != 0))
317 print_header (Elf *elf)
323 int ddigits = length_map[gelf_getclass (elf) - 1][radix_decimal];
324 int xdigits = length_map[gelf_getclass (elf) - 1][radix_hex];
340 handle_ar (int fd, Elf *elf, const char *prefix, const char *fname)
359 while ((subelf = elf_begin (fd, cmd, elf)) != NULL)
378 if (unlikely (elf_end (elf) != 0))
387 show_sysv (Elf *elf, const char *prefix, const char *fname,
391 const int digits = length_map[gelf_getclass (elf) - 1][radix];
395 if (unlikely (elf_getshdrstrndx (elf, &shstrndx) < 0))
400 while ((scn = elf_nextscn (elf, scn)) != NULL)
409 const char *name = elf_strptr (elf, shstrndx, shdr->sh_name);
424 while ((scn = elf_nextscn (elf, scn)) != NULL)
440 maxlen, elf_strptr (elf, shstrndx, shdr->sh_name),
462 show_sysv_one_line (Elf *elf)
466 if (unlikely (elf_getshdrstrndx (elf, &shstrndx) < 0))
473 while ((scn = elf_nextscn (elf, scn)) != NULL)
492 shdr->sh_size, elf_strptr (elf, shstrndx, shdr->sh_name));
514 show_bsd (Elf *elf, const char *prefix, const char *fname,
520 const int ddigits = length_map[gelf_getclass (elf) - 1][radix_decimal];
521 const int xdigits = length_map[gelf_getclass (elf) - 1][radix_hex];
525 while ((scn = elf_nextscn (elf, scn)) != NULL)
564 totals_class = MAX (totals_class, gelf_getclass (elf));
588 show_segments (Elf *elf, const char *fullname)
591 if (elf_getphdrnum (elf, &phnum) != 0)
601 phdr = gelf_getphdr (elf, cnt, &phdr_mem);
634 handle_elf (Elf *elf, const char *prefix, const char *fname)
650 show_sysv (elf, prefix, fname, fullname);
652 show_sysv_one_line (elf);
654 show_segments (elf, fullname);
657 print_header (elf);
659 show_bsd (elf, prefix, fname, fullname);