perf symbol: Add LoongArch case in get_plt_sizes()
[linux-2.6-microblaze.git] / tools / perf / util / symbol-elf.c
index e6493d1..8bd466d 100644 (file)
 #define EM_AARCH64     183  /* ARM 64 bit */
 #endif
 
+#ifndef EM_LOONGARCH
+#define EM_LOONGARCH   258
+#endif
+
 #ifndef ELF32_ST_VISIBILITY
 #define ELF32_ST_VISIBILITY(o) ((o) & 0x03)
 #endif
@@ -438,6 +442,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;