Lines Matching defs:elf

93 static int handle_ar (int fd, Elf *elf, const char *prefix, const char *fname,
97 static int handle_elf (Elf *elf, const char *prefix, const char *fname,
245 Elf *elf = elf_begin (fd, ELF_C_READ_MMAP, NULL);
246 if (elf != NULL)
248 if (elf_kind (elf) == ELF_K_ELF)
250 int result = handle_elf (elf, more_than_one ? "" : NULL,
253 if (elf_end (elf) != 0)
261 else if (elf_kind (elf) == ELF_K_AR)
263 int result = handle_ar (fd, elf, NULL, fname, NULL);
265 if (elf_end (elf) != 0)
275 if (elf_end (elf) != 0)
286 handle_ar (int fd, Elf *elf, const char *prefix, const char *fname,
310 while ((subelf = elf_begin (fd, cmd, elf)) != NULL)
348 int elfclass = gelf_getclass (ebl->elf);
365 elf_strptr (ebl->elf, symstrndx, sym->st_name));
370 destshdr = gelf_getshdr (elf_getscn (ebl->elf,
382 elf_strptr (ebl->elf, shstrndx, destshdr->sh_name));
404 size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_REL, 1, EV_CURRENT);
425 size_t sh_entsize = gelf_fsize (ebl->elf, ELF_T_RELA, 1, EV_CURRENT);
442 section_match (Elf *elf, uint32_t scnndx, GElf_Shdr *shdr, size_t shstrndx)
448 const char *name = elf_strptr (elf, shstrndx, shdr->sh_name);
474 int elfclass = gelf_getclass (ebl->elf);
477 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
487 if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx))
491 GElf_Shdr *destshdr = gelf_getshdr (elf_getscn (ebl->elf,
499 elf_strptr (ebl->elf, shstrndx, destshdr->sh_name),
508 Elf_Scn *symscn = elf_getscn (ebl->elf, shdr->sh_link);
518 while ((xndxscn = elf_nextscn (ebl->elf, xndxscn)) != NULL)
552 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
562 if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx))
566 elf_strptr (ebl->elf, shstrndx, shdr->sh_name));
684 DisasmCtx_t *ctx = disasm_begin (ebl, ebl->elf, NULL /* XXX TODO */);
689 while ((scn = elf_nextscn (ebl->elf, scn)) != NULL)
700 if (! section_match (ebl->elf, elf_ndxscn (scn), shdr, shstrndx))
708 elf_strptr (ebl->elf, shstrndx, shdr->sh_name));
750 handle_elf (Elf *elf, const char *prefix, const char *fname,
755 Ebl *ebl = ebl_openbackend (elf);
757 error_exit (0, _("cannot create backend for elf file"));
759 printf ("%s: elf%d-%s\n\n",
760 fname, gelf_getclass (elf) == ELFCLASS32 ? 32 : 64,
777 if (elf_getshdrstrndx (ebl->elf, &shstrndx) < 0)