Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf symbols: Record whether a symbol is an alias for an IFUNC symbol

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>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
05963491 78250284

+6
+4
tools/perf/util/symbol.c
··· 201 201 continue; 202 202 203 203 if (choose_best_symbol(curr, next) == SYMBOL_A) { 204 + if (next->type == STT_GNU_IFUNC) 205 + curr->ifunc_alias = true; 204 206 rb_erase_cached(&next->rb_node, symbols); 205 207 symbol__delete(next); 206 208 goto again; 207 209 } else { 210 + if (curr->type == STT_GNU_IFUNC) 211 + next->ifunc_alias = true; 208 212 nd = rb_next(&curr->rb_node); 209 213 rb_erase_cached(&curr->rb_node, symbols); 210 214 symbol__delete(curr);
+2
tools/perf/util/symbol.h
··· 64 64 u8 inlined:1; 65 65 /** Has symbol__annotate2 been performed. */ 66 66 u8 annotate2:1; 67 + /** Symbol is an alias of an STT_GNU_IFUNC */ 68 + u8 ifunc_alias:1; 67 69 /** Architecture specific. Unused except on PPC where it holds st_other. */ 68 70 u8 arch_sym; 69 71 /** The name of length namelen associated with the symbol. */