]> git.itanic.dy.fi Git - linux-stable/commitdiff
perf symbols: Record whether a symbol is an alias for an IFUNC symbol
authorAdrian Hunter <adrian.hunter@intel.com>
Tue, 31 Jan 2023 13:16:20 +0000 (15:16 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 2 Feb 2023 00:49:29 +0000 (21:49 -0300)
To assist with synthesizing plt symbols for IFUNCs, record whether a
symbol is an alias of an IFUNC symbol.

Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/r/20230131131625.6964-5-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/symbol.c
tools/perf/util/symbol.h

index a024f06f75d87396a5f7384ec5eeb024ceeecde4..d05727fcb30d2aff8ebf75407fb0d6b5183b26f3 100644 (file)
@@ -201,10 +201,14 @@ void symbols__fixup_duplicate(struct rb_root_cached *symbols)
                        continue;
 
                if (choose_best_symbol(curr, next) == SYMBOL_A) {
+                       if (next->type == STT_GNU_IFUNC)
+                               curr->ifunc_alias = true;
                        rb_erase_cached(&next->rb_node, symbols);
                        symbol__delete(next);
                        goto again;
                } else {
+                       if (curr->type == STT_GNU_IFUNC)
+                               next->ifunc_alias = true;
                        nd = rb_next(&curr->rb_node);
                        rb_erase_cached(&curr->rb_node, symbols);
                        symbol__delete(curr);
index 2fdeb22bd02f7735c3c31868f5d7847893eba8e4..7558735543c25d8033ef25f6292a38c3b5b56111 100644 (file)
@@ -64,6 +64,8 @@ struct symbol {
        u8              inlined:1;
        /** Has symbol__annotate2 been performed. */
        u8              annotate2:1;
+       /** Symbol is an alias of an STT_GNU_IFUNC */
+       u8              ifunc_alias:1;
        /** Architecture specific. Unused except on PPC where it holds st_other. */
        u8              arch_sym;
        /** The name of length namelen associated with the symbol. */