linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf symbol: Add LoongArch case in get_plt_sizes()
@ 2023-05-09  6:55 Tiezhu Yang
  2023-05-18  2:11 ` Huacai Chen
  0 siblings, 1 reply; 13+ messages in thread
From: Tiezhu Yang @ 2023-05-09  6:55 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter
  Cc: linux-perf-users, loongarch, linux-kernel, loongson-kernel

We can see the following definitions in bfd/elfnn-loongarch.c:

  #define PLT_HEADER_INSNS 8
  #define PLT_HEADER_SIZE (PLT_HEADER_INSNS * 4)

  #define PLT_ENTRY_INSNS 4
  #define PLT_ENTRY_SIZE (PLT_ENTRY_INSNS * 4)

so plt header size is 32 and plt entry size is 16 on LoongArch,
let us add LoongArch case in get_plt_sizes().

Link: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elfnn-loongarch.c
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---

This is based on 6.4-rc1

 tools/perf/util/symbol-elf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
index b2ed9cc..5d409c2 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -411,6 +411,10 @@ static bool get_plt_sizes(struct dso *dso, GElf_Ehdr *ehdr, GElf_Shdr *shdr_plt,
 		*plt_header_size = 32;
 		*plt_entry_size = 16;
 		return true;
+	case EM_LOONGARCH:
+		*plt_header_size = 32;
+		*plt_entry_size = 16;
+		return true;
 	case EM_SPARC:
 		*plt_header_size = 48;
 		*plt_entry_size = 12;
-- 
2.1.0


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-05-23  9:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-09  6:55 [PATCH] perf symbol: Add LoongArch case in get_plt_sizes() Tiezhu Yang
2023-05-18  2:11 ` Huacai Chen
2023-05-18  3:06   ` Leo Yan
2023-05-18  3:12     ` Huacai Chen
2023-05-18  3:21       ` Leo Yan
2023-05-18  3:57         ` Huacai Chen
2023-05-18  4:05           ` Leo Yan
2023-05-18 12:16             ` Arnaldo Carvalho de Melo
2023-05-22  3:50               ` Huacai Chen
2023-05-22  7:58                 ` Tiezhu Yang
2023-05-23  1:47                   ` Huacai Chen
2023-05-23  7:30                     ` Leo Yan
2023-05-23  9:02                       ` Tiezhu Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).