diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-04-26 17:45:17 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-04-26 18:47:20 +0200 |
commit | 18231d79466e6b183b4f3b2aa66231fb4052fb85 (patch) | |
tree | 409bc5930e43476cd18ab68b88e4b0573fe62d2a /tools/perf | |
parent | perf symbols: No need to special case MAP__FUNCTION in fixup (diff) | |
download | linux-18231d79466e6b183b4f3b2aa66231fb4052fb85.tar.xz linux-18231d79466e6b183b4f3b2aa66231fb4052fb85.zip |
perf symbols: Use symbol type instead of map->type
map->type is going away, we can derive it from map->prot, so use
the same logic as in the kernel's arch/arm/kernel/module.c file:
ELF32_ST_TYPE(sym->st_info) == STT_FUNC && !(sym->st_value & 1))
This was introduced in b2f8fb237e9c ("perf symbols: Fix annotation of
thumb code"), that fix is maintained with this change.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Dave Martin <dave.martin@linaro.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Dr. David Alan Gilbert <david.gilbert@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-us590h81uqgxaumucfttqj50@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/symbol-elf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index cf2e6f428bb4..82a1aadc245f 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -982,7 +982,7 @@ int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, /* On ARM, symbols for thumb functions have 1 added to * the symbol address as a flag - remove it */ if ((ehdr.e_machine == EM_ARM) && - (map->type == MAP__FUNCTION) && + (GELF_ST_TYPE(sym.st_info) == STT_FUNC) && (sym.st_value & 1)) --sym.st_value; |