symsrc.h 907 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __PERF_SYMSRC_
  3. #define __PERF_SYMSRC_ 1
  4. #include <stdbool.h>
  5. #include <stddef.h>
  6. #include "dso.h"
  7. #ifdef HAVE_LIBELF_SUPPORT
  8. #include <libelf.h>
  9. #include <gelf.h>
  10. #endif
  11. #include <elf.h>
  12. struct symsrc {
  13. char *name;
  14. int fd;
  15. enum dso_binary_type type;
  16. #ifdef HAVE_LIBELF_SUPPORT
  17. Elf *elf;
  18. GElf_Ehdr ehdr;
  19. Elf_Scn *opdsec;
  20. size_t opdidx;
  21. GElf_Shdr opdshdr;
  22. Elf_Scn *symtab;
  23. GElf_Shdr symshdr;
  24. Elf_Scn *dynsym;
  25. size_t dynsym_idx;
  26. GElf_Shdr dynshdr;
  27. bool adjust_symbols;
  28. bool is_64_bit;
  29. #endif
  30. };
  31. int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name, enum dso_binary_type type);
  32. void symsrc__destroy(struct symsrc *ss);
  33. bool symsrc__has_symtab(struct symsrc *ss);
  34. bool symsrc__possibly_runtime(struct symsrc *ss);
  35. #endif /* __PERF_SYMSRC_ */