Home | History | Annotate | Download | only in src

Lines Matching refs:elf

1 /* Print symbol information from ELF file in human-readable form.
127 static int handle_ar (int fd, Elf *elf, const char *prefix, const char *fname,
130 /* Handle ELF file. */
131 static int handle_elf (Elf *elf, const char *prefix, const char *fname,
367 /* Now get the ELF descriptor. */
368 Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
369 if (elf != NULL)
371 if (elf_kind (elf) == ELF_K_ELF)
373 int result = handle_elf (elf, more_than_one ? "" : NULL,
376 if (elf_end (elf) != 0)
384 else if (elf_kind (elf) == ELF_K_AR)
386 int result = handle_ar (fd, elf, NULL, fname, NULL);
388 if (elf_end (elf) != 0)
398 if (elf_end (elf) != 0)
409 handle_ar (int fd, Elf *elf, const char *prefix, const char *fname,
417 Elf *subelf;
435 Elf_Arsym *arsym = elf_getarsym (elf, NULL);
447 && (elf_rand (elf, arsym->as_off) != arsym->as_off
448 || (subelf = elf_begin (fd, cmd, elf)) == NULL
461 if (elf_rand (elf, SARMAG) != SARMAG)
471 while ((subelf = elf_begin (fd, cmd, elf)) != NULL)
708 sym_name (Elf *elf, GElf_Word strndx, GElf_Word st_name, char buf[], size_t n)
710 const char *symstr = elf_strptr (elf, strndx, st_name);
727 if (elf_getshnum (ebl->elf, &shnum) < 0)
738 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
745 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
751 char *name = elf_strptr (ebl->elf, shstrndx,
762 int digits = length_map[gelf_getclass (ebl->elf) - 1][radix];
794 const char *symstr = sym_name (ebl->elf, strndx, syms[cnt].sym.st_name,
848 show_symbols_bsd (Elf *elf, GElf_Word strndx,
852 int digits = length_map[gelf_getclass (elf) - 1][radix];
874 const char *symstr = sym_name (elf, strndx, syms[cnt].sym.st_name,
913 show_symbols_posix (Elf *elf, GElf_Word strndx, const char *prefix,
927 int digits = length_map[gelf_getclass (elf) - 1][radix];
933 const char *symstr = sym_name (elf, strndx, syms[cnt].sym.st_name,
1000 if (elf_getshstrndx (ebl->elf, &shstrndx) < 0)
1010 if (entsize != gelf_fsize (ebl->elf, ELF_T_SYM, 1, ehdr->e_version))
1013 fullname, elf_strptr (ebl->elf, shstrndx, shdr->sh_name));
1017 fullname, elf_strptr (ebl->elf, shstrndx, shdr->sh_name));
1033 dbg = dwarf_begin_elf (ebl->elf, DWARF_C_READ, NULL);
1081 const char *symstr = elf_strptr (ebl->elf, shdr->sh_link,
1177 sort_by_name_strtab = elf_getdata (elf_getscn (ebl->elf, shdr->sh_link),
1194 show_symbols_bsd (ebl->elf, shdr->sh_link, prefix, fname, fullname,
1201 show_symbols_posix (ebl->elf, shdr->sh_link, prefix, fullname, sym_mem,
1226 handle_elf (Elf *elf, const char *prefix, const char *fname,
1242 ebl = ebl_openbackend (elf);
1244 /* We need the ELF header in a few places. */
1245 ehdr = gelf_getehdr (elf, &ehdr_mem);
1271 while ((scn = elf_nextscn (elf, scn)) != NULL)
1291 while ((xndxscn = elf_nextscn (elf, xndxscn)) != NULL)
1318 /* Close the ELF backend library descriptor. */