linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Ian Rogers <irogers@google.com>,
	linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org
Subject: [PATCH 4/9] perf symbols: Record whether a symbol is an alias for an IFUNC symbol
Date: Fri, 27 Jan 2023 19:02:17 +0200	[thread overview]
Message-ID: <20230127170222.9895-5-adrian.hunter@intel.com> (raw)
In-Reply-To: <20230127170222.9895-1-adrian.hunter@intel.com>

To assist with synthesizing plt symbols for IFUNCs, record whether a
symbol is an alias of an IFUNC symbol.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/util/symbol.c | 4 ++++
 tools/perf/util/symbol.h | 2 ++
 2 files changed, 6 insertions(+)

diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index a024f06f75d8..d05727fcb30d 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -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);
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 2fdeb22bd02f..7558735543c2 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -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. */
-- 
2.34.1


  parent reply	other threads:[~2023-01-27 17:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 17:02 [PATCH 0/9] perf symbols: Improve dso__synthesize_plt_symbols() for x86 Adrian Hunter
2023-01-27 17:02 ` [PATCH 1/9] perf symbols: Correct plt entry sizes " Adrian Hunter
2023-01-27 17:02 ` [PATCH 2/9] perf symbols: Add support for x86 .plt.sec Adrian Hunter
2023-01-30 17:34   ` Namhyung Kim
2023-01-30 18:35     ` Adrian Hunter
2023-01-30 22:22       ` Namhyung Kim
2023-01-31 10:14         ` Adrian Hunter
2023-01-27 17:02 ` [PATCH 3/9] perf symbols: Sort plt relocations for x86 Adrian Hunter
2023-01-27 17:02 ` Adrian Hunter [this message]
2023-01-27 17:02 ` [PATCH 5/9] perf symbols: Add support for IFUNC symbols for x86_64 Adrian Hunter
2023-01-27 17:02 ` [PATCH 6/9] perf symbols: Allow for .plt without header Adrian Hunter
2023-01-27 17:02 ` [PATCH 7/9] perf symbols: Allow for static executables with .plt Adrian Hunter
2023-01-27 17:02 ` [PATCH 8/9] perf symbols: Start adding support for .plt.got for x86 Adrian Hunter
2023-01-27 17:02 ` [PATCH 9/9] perf symbols: Get symbols for .plt.got for x86-64 Adrian Hunter
2023-01-30 23:26   ` Namhyung Kim
2023-01-31 10:17     ` Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230127170222.9895-5-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).