aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/genelf.h
diff options
context:
space:
mode:
authorLieven Hey <lieven.hey@kdab.com>2022-09-15 11:29:10 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-09-21 10:30:55 -0300
commitbabd04386b1df8c364cdaa39ac0e54349502e1e5 (patch)
tree3f7b902bf91f71ee36a59692e9d73e4f6b1a83ec /tools/perf/util/genelf.h
parentperf test: Add a new test for perf stat cgroup BPF counter (diff)
downloadlinux-dev-babd04386b1df8c364cdaa39ac0e54349502e1e5.tar.xz
linux-dev-babd04386b1df8c364cdaa39ac0e54349502e1e5.zip
perf jit: Include program header in ELF files
The missing header makes it hard for programs like elfutils to open these files. Fixes: 2d86612aacb7805f ("perf symbol: Correct address for bss symbols") Reviewed-by: Leo Yan <leo.yan@linaro.org> Signed-off-by: Lieven Hey <lieven.hey@kdab.com> Tested-by: Leo Yan <leo.yan@linaro.org> Cc: Leo Yan <leo.yan@linaro.org> Link: https://lore.kernel.org/r/20220915092910.711036-1-lieven.hey@kdab.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/genelf.h')
-rw-r--r--tools/perf/util/genelf.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/perf/util/genelf.h b/tools/perf/util/genelf.h
index ae138afe6c56..b5c909546e3f 100644
--- a/tools/perf/util/genelf.h
+++ b/tools/perf/util/genelf.h
@@ -53,8 +53,10 @@ int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_ent
#if GEN_ELF_CLASS == ELFCLASS64
#define elf_newehdr elf64_newehdr
+#define elf_newphdr elf64_newphdr
#define elf_getshdr elf64_getshdr
#define Elf_Ehdr Elf64_Ehdr
+#define Elf_Phdr Elf64_Phdr
#define Elf_Shdr Elf64_Shdr
#define Elf_Sym Elf64_Sym
#define ELF_ST_TYPE(a) ELF64_ST_TYPE(a)
@@ -62,8 +64,10 @@ int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_ent
#define ELF_ST_VIS(a) ELF64_ST_VISIBILITY(a)
#else
#define elf_newehdr elf32_newehdr
+#define elf_newphdr elf32_newphdr
#define elf_getshdr elf32_getshdr
#define Elf_Ehdr Elf32_Ehdr
+#define Elf_Phdr Elf32_Phdr
#define Elf_Shdr Elf32_Shdr
#define Elf_Sym Elf32_Sym
#define ELF_ST_TYPE(a) ELF32_ST_TYPE(a)