[RFC PATCH 11/12] perf symbols: Add RISC-V PLT entry sizes

From: Zane Leung

Date: Mon Apr 13 2026 - 23:46:54 EST


From: liangzhen <zhen.liang@xxxxxxxxxxxx>

Add PLT header and entry size definitions for RISC-V architecture.

RISC-V uses:
- PLT header size: 32 bytes
- PLT entry size: 16 bytes

This allows perf to correctly identify and display PLT symbols
instead of showing them as [unknown].

Signed-off-by: liangzhen <zhen.liang@xxxxxxxxxxxx>
---
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 76912c62b6a0..e54ff59eb6ef 100644
--- a/tools/perf/util/symbol-elf.c
+++ b/tools/perf/util/symbol-elf.c
@@ -379,6 +379,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_RISCV:
+ *plt_header_size = 32;
+ *plt_entry_size = 16;
+ return true;
case EM_SPARC:
*plt_header_size = 48;
*plt_entry_size = 12;
--
2.34.1