0001
0002 #ifndef __PERF_SYMSRC_
0003 #define __PERF_SYMSRC_ 1
0004
0005 #include <stdbool.h>
0006 #include <stddef.h>
0007 #include "dso.h"
0008
0009 #ifdef HAVE_LIBELF_SUPPORT
0010 #include <libelf.h>
0011 #include <gelf.h>
0012 #endif
0013 #include <elf.h>
0014
0015 struct symsrc {
0016 char *name;
0017 int fd;
0018 enum dso_binary_type type;
0019
0020 #ifdef HAVE_LIBELF_SUPPORT
0021 Elf *elf;
0022 GElf_Ehdr ehdr;
0023
0024 Elf_Scn *opdsec;
0025 size_t opdidx;
0026 GElf_Shdr opdshdr;
0027
0028 Elf_Scn *symtab;
0029 GElf_Shdr symshdr;
0030
0031 Elf_Scn *dynsym;
0032 size_t dynsym_idx;
0033 GElf_Shdr dynshdr;
0034
0035 bool adjust_symbols;
0036 bool is_64_bit;
0037 #endif
0038 };
0039
0040 int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name, enum dso_binary_type type);
0041 void symsrc__destroy(struct symsrc *ss);
0042
0043 bool symsrc__has_symtab(struct symsrc *ss);
0044 bool symsrc__possibly_runtime(struct symsrc *ss);
0045
0046 #endif