Lines Matching defs:elf

17 	Elf *elf;
20 pr_warn("elf: failed to init libelf for %s\n", binary_path);
26 pr_warn("elf: failed to open %s: %s\n", binary_path,
30 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL);
31 if (!elf) {
32 pr_warn("elf: could not read elf from %s: %s\n", binary_path, elf_errmsg(-1));
37 elf_fd->elf = elf;
45 elf_end(elf_fd->elf);
50 static Elf_Scn *elf_find_next_scn_by_type(Elf *elf, int sh_type, Elf_Scn *scn)
52 while ((scn = elf_nextscn(elf, scn)) != NULL) {
70 Elf *elf;
80 Elf *elf, const char *binary_path,
89 if (!gelf_getehdr(elf, &ehdr)) {
90 pr_warn("elf: failed to get ehdr from %s: %s\n", binary_path, elf_errmsg(-1));
94 scn = elf_find_next_scn_by_type(elf, sh_type, NULL);
96 pr_debug("elf: failed to find symbol table ELF sections in '%s'\n",
107 pr_warn("elf: failed to get symbols for symtab section in '%s': %s\n",
112 iter->elf = elf;
130 name = elf_strptr(iter->elf, iter->strtabidx, sym->st_name);
133 sym_scn = elf_getscn(iter->elf, sym->st_shndx);
162 * the path to the ELF binary represented by "elf", and only used for error
166 long elf_find_func_offset(Elf *elf, const char *binary_path, const char *name)
174 if (!gelf_getehdr(elf, &ehdr)) {
175 pr_warn("elf: failed to get ehdr from %s: %s\n", binary_path, elf_errmsg(-1));
197 ret = elf_sym_iter_new(&iter, elf, binary_path, sh_types[i], STT_FUNC);
219 pr_warn("elf: ambiguous match for '%s', '%s' in '%s'\n",
239 pr_debug("elf: symbol address match for '%s' in '%s': 0x%lx\n", name, binary_path,
243 pr_warn("elf: '%s' is 0 in symtab for '%s': %s\n", name, binary_path,
248 pr_warn("elf: failed to find symbol '%s' in '%s'\n", name, binary_path);
266 ret = elf_find_func_offset(elf_fd.elf, binary_path, name);
322 err = elf_sym_iter_new(&iter, elf_fd.elf, binary_path, sh_types[i], STT_FUNC);
348 pr_warn("elf: ambiguous match found '%s@%lu' in '%s' previous offset %lu\n",
403 err = elf_sym_iter_new(&iter, elf_fd.elf, binary_path, sh_types[i], STT_FUNC);