Skip to content

Commit 765be32

Browse files
seehearfeelnamhyung
authored andcommitted
perf symbol: Add LoongArch case in get_plt_sizes()
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(). Signed-off-by: Tiezhu Yang <[email protected]> Acked-by: Huacai Chen <[email protected]> Reviewed-by: Leo Yan <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: [email protected] Cc: [email protected] Cc: Ingo Molnar <[email protected]> Link: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=bfd/elfnn-loongarch.c Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent d7c2d34 commit 765be32

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/perf/util/symbol-elf.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
#define EM_AARCH64 183 /* ARM 64 bit */
4343
#endif
4444

45+
#ifndef EM_LOONGARCH
46+
#define EM_LOONGARCH 258
47+
#endif
48+
4549
#ifndef ELF32_ST_VISIBILITY
4650
#define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
4751
#endif
@@ -438,6 +442,10 @@ static bool get_plt_sizes(struct dso *dso, GElf_Ehdr *ehdr, GElf_Shdr *shdr_plt,
438442
*plt_header_size = 32;
439443
*plt_entry_size = 16;
440444
return true;
445+
case EM_LOONGARCH:
446+
*plt_header_size = 32;
447+
*plt_entry_size = 16;
448+
return true;
441449
case EM_SPARC:
442450
*plt_header_size = 48;
443451
*plt_entry_size = 12;

0 commit comments

Comments
 (0)