Lines Matching defs:elf

29 	Elf *elf;
32 pr_warn("elf: failed to init libelf for %s\n", binary_path);
38 pr_warn("elf: failed to open %s: %s\n", binary_path,
42 elf = elf_begin(fd, ELF_C_READ_MMAP, NULL);
43 if (!elf) {
44 pr_warn("elf: could not read elf from %s: %s\n", binary_path, elf_errmsg(-1));
49 elf_fd->elf = elf;
57 elf_end(elf_fd->elf);
62 static Elf_Scn *elf_find_next_scn_by_type(Elf *elf, int sh_type, Elf_Scn *scn)
64 while ((scn = elf_nextscn(elf, scn)) != NULL) {
84 Elf *elf;
97 Elf *elf, const char *binary_path,
106 if (!gelf_getehdr(elf, &ehdr)) {
107 pr_warn("elf: failed to get ehdr from %s: %s\n", binary_path, elf_errmsg(-1));
111 scn = elf_find_next_scn_by_type(elf, sh_type, NULL);
113 pr_debug("elf: failed to find symbol table ELF sections in '%s'\n",
124 pr_warn("elf: failed to get symbols for symtab section in '%s': %s\n",
129 iter->elf = elf;
136 scn = elf_find_next_scn_by_type(elf, SHT_GNU_versym, NULL);
141 scn = elf_find_next_scn_by_type(elf, SHT_GNU_verdef, NULL);
147 pr_warn("elf: failed to get verdef ELF section in '%s'\n", binary_path);
169 name = elf_strptr(iter->elf, iter->strtabidx, sym->st_name);
172 sym_scn = elf_getscn(iter->elf, sym->st_shndx);
217 return elf_strptr(iter->elf, iter->verdef_strtabidx, verdaux.vda_name);
272 * the path to the ELF binary represented by "elf", and only used for error
276 long elf_find_func_offset(Elf *elf, const char *binary_path, const char *name)
285 if (!gelf_getehdr(elf, &ehdr)) {
286 pr_warn("elf: failed to get ehdr from %s: %s\n", binary_path, elf_errmsg(-1));
317 ret = elf_sym_iter_new(&iter, elf, binary_path, sh_types[i], STT_FUNC);
336 pr_warn("elf: ambiguous match for '%s', '%s' in '%s'\n",
356 pr_debug("elf: symbol address match for '%s' in '%s': 0x%lx\n", name, binary_path,
360 pr_warn("elf: '%s' is 0 in symtab for '%s': %s\n", name, binary_path,
365 pr_warn("elf: failed to find symbol '%s' in '%s'\n", name, binary_path);
383 ret = elf_find_func_offset(elf_fd.elf, binary_path, name);
440 err = elf_sym_iter_new(&iter, elf_fd.elf, binary_path, sh_types[i], st_type);
466 pr_warn("elf: ambiguous match found '%s@%lu' in '%s' previous offset %lu\n",
521 err = elf_sym_iter_new(&iter, elf_fd.elf, binary_path, sh_types[i], STT_FUNC);