Home | History | Annotate | Download | only in libdwfl

Lines Matching refs:Elf

56 /* Open libelf FILE->fd and compute the load base of ELF as loaded in MOD.
57 When we return success, FILE->elf and FILE->bias are set up. */
61 if (file->elf == NULL)
71 file->elf = elf_begin (file->fd, ELF_C_READ_MMAP_PRIVATE, NULL);
74 if (unlikely (elf_kind (file->elf) != ELF_K_ELF))
81 GElf_Ehdr ehdr_mem, *ehdr = gelf_getehdr (file->elf, &ehdr_mem);
99 GElf_Phdr *ph = gelf_getphdr (file->elf, i, &ph_mem);
119 /* Find the main ELF file for this module and open libelf on it.
120 When we return success, MOD->main.elf and MOD->main.bias are set up. */
124 if (mod->main.elf != NULL /* Already done. */
130 &mod->main.elf);
143 /* Search an ELF file for a ".gnu_debuglink" section. */
145 find_debuglink (Elf *elf, GElf_Word *crc)
148 if (elf_getshstrndx (elf, &shstrndx) < 0)
152 while ((scn = elf_nextscn (elf, scn)) != NULL)
159 const char *name = elf_strptr (elf, shstrndx, shdr->sh_name);
191 GElf_Ehdr *ehdr = gelf_getehdr (elf, &ehdr_mem);
195 Elf_Data *d = gelf_xlatetom (elf, &crcdata, &conv, ehdr->e_ident[EI_DATA]);
209 if (mod->debug.elf != NULL)
213 const char *debuglink_file = find_debuglink (mod->main.elf, &debuglink_crc);
234 while ((scn = elf_nextscn (file->elf, scn)) != NULL)
285 find_offsets (Elf *elf, const GElf_Ehdr *ehdr, size_t n,
292 GElf_Phdr *phdr = gelf_getphdr (elf, i, &phdr_mem);
311 GElf_Ehdr *ehdr = gelf_getehdr (mod->main.elf, &ehdr_mem);
316 GElf_Phdr *phdr = gelf_getphdr (mod->main.elf, i, &phdr_mem);
324 Elf_Data *data = elf_getdata_rawchunk (mod->main.elf,
340 size_t n = data->d_size / gelf_fsize (mod->main.elf,
380 find_offsets (mod->main.elf, ehdr, i_max, addrs, offs);
388 data = elf_getdata_rawchunk (mod->main.elf,
409 data = elf_getdata_rawchunk (mod->main.elf, offs[i_gnu_hash],
417 + (gelf_getclass (mod->main.elf)
421 data = elf_getdata_rawchunk (mod->main.elf, buckets_at,
437 data = elf_getdata_rawchunk (mod->main.elf,
455 / gelf_fsize (mod->main.elf,
460 mod->symdata = elf_getdata_rawchunk (mod->main.elf,
462 gelf_fsize (mod->main.elf,
469 mod->symstrdata = elf_getdata_rawchunk (mod->main.elf,
489 /* Try to find a symbol table in either MOD->main.elf or MOD->debug.elf. */
502 /* First see if the main ELF file has the debugging information. */
557 if (elf_strptr (mod->symfile->elf, strshndx, 0) == NULL)
566 mod->symstrdata = elf_getdata (elf_getscn (mod->symfile->elf, strshndx),
597 mod->ebl = ebl_openbackend (mod->main.elf);
623 result = __libdwfl_relocate (mod, debugfile->elf, true);
628 if (mod->main.fd != -1 && elf_cntl (mod->main.elf, ELF_C_FDREAD) == 0)
633 if (debugfile->fd != -1 && elf_cntl (debugfile->elf, ELF_C_FDREAD) == 0)
640 mod->dw = INTUSE(dwarf_begin_elf) (debugfile->elf, DWARF_C_READ, NULL);
666 /* First see if the main ELF file has the debugging information. */
671 mod->debug.elf = mod->main.elf;
703 Elf *
714 /* Before letting them get at the Elf handle,
720 (void) __libdwfl_relocate (mod, mod->main.elf, false);
722 if (mod->debug.elf == mod->main.elf)
724 else if (mod->debug.elf != NULL && ! mod->debug.relocated)
727 (void) __libdwfl_relocate (mod, mod->debug.elf, false);
733 return mod->main.elf;
757 if (mod->debug.elf != mod->main.elf)
758 (void) __libdwfl_relocate (mod, mod->debug.elf, false);