Home | History | Annotate | Download | only in util

Lines Matching refs:Elf

22 #include <elf.h>
41 static int elf_read_build_id(Elf *elf, void *bf, size_t size);
565 * the original ELF section names vmlinux have.
845 static Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
852 while ((sec = elf_nextscn(elf, sec)) != NULL) {
856 str = elf_strptr(elf, ep->e_shstrndx, shp->sh_name);
899 Elf *elf;
909 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
910 if (elf == NULL)
913 if (gelf_getehdr(elf, &ehdr) == NULL)
916 scn_dynsym = elf_section_by_name(elf, &ehdr, &shdr_dynsym,
921 scn_plt_rel = elf_section_by_name(elf, &ehdr, &shdr_rel_plt,
924 scn_plt_rel = elf_section_by_name(elf, &ehdr, &shdr_rel_plt,
935 if (elf_section_by_name(elf, &ehdr, &shdr_plt, ".plt", NULL) == NULL)
950 scn_symstrs = elf_getscn(elf, shdr_dynsym.sh_link);
1010 elf_end(elf);
1047 static size_t elf_addr_to_index(Elf *elf, GElf_Addr addr)
1053 while ((sec = elf_nextscn(elf, sec)) != NULL) {
1082 Elf *elf;
1086 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
1087 if (elf == NULL) {
1088 pr_debug("%s: cannot read %s ELF file.\n", __func__, name);
1092 if (gelf_getehdr(elf, &ehdr) == NULL) {
1093 pr_debug("%s: cannot get elf header.\n", __func__);
1101 if (elf_read_build_id(elf, build_id,
1109 sec = elf_section_by_name(elf, &ehdr, &shdr, ".symtab", NULL);
1114 sec = elf_section_by_name(elf, &ehdr, &shdr, ".dynsym", NULL);
1119 opdsec = elf_section_by_name(elf, &ehdr, &opdshdr, ".opd", &opdidx);
1129 sec = elf_getscn(elf, shdr.sh_link);
1137 sec_strndx = elf_getscn(elf, ehdr.e_shstrndx);
1150 elf_section_by_name(elf, &ehdr, &shdr,
1170 /* Reject ARM ELF "mapping symbols": these aren't unique and
1184 sym.st_shndx = elf_addr_to_index(elf, sym.st_value);
1187 sec = elf_getscn(elf, sym.st_shndx);
1298 elf_end(elf);
1335 static int elf_read_build_id(Elf *elf, void *bf, size_t size)
1348 ek = elf_kind(elf);
1352 if (gelf_getehdr(elf, &ehdr) == NULL) {
1353 pr_err("%s: cannot get elf header.\n", __func__);
1357 sec = elf_section_by_name(elf, &ehdr, &shdr,
1360 sec = elf_section_by_name(elf, &ehdr, &shdr,
1398 Elf *elf;
1407 elf = elf_begin(fd, PERF_ELF_C_READ_MMAP, NULL);
1408 if (elf == NULL) {
1409 pr_debug2("%s: cannot read %s ELF file.\n", __func__, filename);
1413 err = elf_read_build_id(elf, bf, size);
1415 elf_end(elf);