Merge branch 'fixes-v5.7' into fixes
[linux-2.6-microblaze.git] / tools / perf / util / symbol-elf.c
index 1965aef..be5b493 100644 (file)
@@ -704,9 +704,15 @@ void symsrc__destroy(struct symsrc *ss)
        close(ss->fd);
 }
 
-bool __weak elf__needs_adjust_symbols(GElf_Ehdr ehdr)
+bool elf__needs_adjust_symbols(GElf_Ehdr ehdr)
 {
-       return ehdr.e_type == ET_EXEC || ehdr.e_type == ET_REL;
+       /*
+        * Usually vmlinux is an ELF file with type ET_EXEC for most
+        * architectures; except Arm64 kernel is linked with option
+        * '-share', so need to check type ET_DYN.
+        */
+       return ehdr.e_type == ET_EXEC || ehdr.e_type == ET_REL ||
+              ehdr.e_type == ET_DYN;
 }
 
 int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name,