OSDN Git Service

Merge 'tip/perf/urgent' into perf/core to pick fixes
[uclinux-h8/linux.git] / tools / perf / util / symbol-elf.c
index b24f9d8..ada1676 100644 (file)
 #include <symbol/kallsyms.h>
 #include "debug.h"
 
+#ifndef EM_AARCH64
+#define EM_AARCH64     183  /* ARM 64 bit */
+#endif
+
+
 #ifdef HAVE_CPLUS_DEMANGLE_SUPPORT
 extern char *cplus_demangle(const char *, int);
 
@@ -69,6 +74,10 @@ static inline uint8_t elf_sym__type(const GElf_Sym *sym)
        return GELF_ST_TYPE(sym->st_info);
 }
 
+#ifndef STT_GNU_IFUNC
+#define STT_GNU_IFUNC 10
+#endif
+
 static inline int elf_sym__is_function(const GElf_Sym *sym)
 {
        return (elf_sym__type(sym) == STT_FUNC ||
@@ -859,10 +868,9 @@ int dso__load_sym(struct dso *dso, struct map *map,
                /* Reject ARM ELF "mapping symbols": these aren't unique and
                 * don't identify functions, so will confuse the profile
                 * output: */
-               if (ehdr.e_machine == EM_ARM) {
-                       if (!strcmp(elf_name, "$a") ||
-                           !strcmp(elf_name, "$d") ||
-                           !strcmp(elf_name, "$t"))
+               if (ehdr.e_machine == EM_ARM || ehdr.e_machine == EM_AARCH64) {
+                       if (elf_name[0] == '$' && strchr("adtx", elf_name[1])
+                           && (elf_name[2] == '\0' || elf_name[2] == '.'))
                                continue;
                }