lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251123023225.8069-6-irogers@google.com>
Date: Sat, 22 Nov 2025 18:32:21 -0800
From: Ian Rogers <irogers@...gle.com>
To: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>, 
	Arnaldo Carvalho de Melo <acme@...nel.org>, Namhyung Kim <namhyung@...nel.org>, 
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>, 
	Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>, 
	Suzuki K Poulose <suzuki.poulose@....com>, Mike Leach <mike.leach@...aro.org>, 
	James Clark <james.clark@...aro.org>, John Garry <john.g.garry@...cle.com>, 
	Will Deacon <will@...nel.org>, Leo Yan <leo.yan@...ux.dev>, 
	Athira Rajeev <atrajeev@...ux.ibm.com>, tanze <tanze@...inos.cn>, 
	Aditya Bodkhe <aditya.b1@...ux.ibm.com>, Stephen Brennan <stephen.s.brennan@...cle.com>, 
	Andi Kleen <ak@...ux.intel.com>, Chun-Tse Shao <ctshao@...gle.com>, 
	Thomas Falcon <thomas.falcon@...el.com>, Dapeng Mi <dapeng1.mi@...ux.intel.com>, 
	"Dr. David Alan Gilbert" <linux@...blig.org>, Christophe Leroy <christophe.leroy@...roup.eu>, 
	"Krzysztof Ɓopatowski" <krzysztof.m.lopatowski@...il.com>, 
	"Masami Hiramatsu (Google)" <mhiramat@...nel.org>, Alexandre Ghiti <alexghiti@...osinc.com>, 
	Haibo Xu <haibo1.xu@...el.com>, Sergei Trofimovich <slyich@...il.com>, linux-kernel@...r.kernel.org, 
	linux-perf-users@...r.kernel.org
Subject: [PATCH v1 5/9] perf symbol: Move dso__load_bfd_symbols out of symbol.h

Move into libbfd.h where the code is and to make it clear that
symbol.h and symbol.c are generic code. Add libbfd.h to symbol.c
includes and organize the includes.

Signed-off-by: Ian Rogers <irogers@...gle.com>
---
 tools/perf/tests/pe-file-parsing.c |  5 ++--
 tools/perf/util/libbfd.h           |  7 ++++++
 tools/perf/util/symbol.c           | 38 +++++++++++++++++-------------
 tools/perf/util/symbol.h           |  4 ----
 4 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/tools/perf/tests/pe-file-parsing.c b/tools/perf/tests/pe-file-parsing.c
index 8b31d1d05f90..2459656b01ac 100644
--- a/tools/perf/tests/pe-file-parsing.c
+++ b/tools/perf/tests/pe-file-parsing.c
@@ -11,10 +11,11 @@
 #include <unistd.h>
 #include <subcmd/exec-cmd.h>
 
-#include "debug.h"
 #include "util/build-id.h"
-#include "util/symbol.h"
+#include "util/debug.h"
 #include "util/dso.h"
+#include "util/libbfd.h"
+#include "util/symbol.h"
 
 #include "tests.h"
 
diff --git a/tools/perf/util/libbfd.h b/tools/perf/util/libbfd.h
index e300f171d1bd..5b5149516f1a 100644
--- a/tools/perf/util/libbfd.h
+++ b/tools/perf/util/libbfd.h
@@ -21,6 +21,7 @@ int libbfd__addr2line(const char *dso_name, u64 addr,
 
 
 void dso__free_a2l_libbfd(struct dso *dso);
+int dso__load_bfd_symbols(struct dso *dso, const char *debugfile);
 
 int symbol__disassemble_libbfd(const char *filename, struct symbol *sym,
 			     struct annotate_args *args);
@@ -51,6 +52,12 @@ static inline void dso__free_a2l_libbfd(struct dso *dso __always_unused)
 {
 }
 
+static inline int dso__load_bfd_symbols(struct dso *dso __always_unused,
+					const char *debugfile __always_unused)
+{
+	return -1;
+}
+
 static inline int symbol__disassemble_libbfd(const char *filename __always_unused,
 					struct symbol *sym __always_unused,
 					struct annotate_args *args __always_unused)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index cc26b7bf302b..638015651547 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1,47 +1,51 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <dirent.h>
 #include <errno.h>
-#include <stdlib.h>
+#include <fcntl.h>
+#include <inttypes.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
-#include <linux/capability.h>
-#include <linux/kernel.h>
-#include <linux/mman.h>
-#include <linux/string.h>
-#include <linux/time64.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <sys/param.h>
-#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
 #include <unistd.h>
-#include <inttypes.h>
+
 #include "annotate.h"
 #include "build-id.h"
 #include "cap.h"
 #include "cpumap.h"
 #include "debug.h"
+#include "debug.h"
 #include "demangle-cxx.h"
 #include "demangle-java.h"
 #include "demangle-ocaml.h"
 #include "demangle-rust-v0.h"
 #include "dso.h"
-#include "util.h" // lsdir()
-#include "debug.h"
 #include "event.h"
+#include "header.h"
+#include "intlist.h"
+#include "libbfd.h"
 #include "machine.h"
 #include "map.h"
-#include "symbol.h"
 #include "map_symbol.h"
 #include "mem-events.h"
 #include "mem-info.h"
-#include "symsrc.h"
-#include "strlist.h"
-#include "intlist.h"
 #include "namespaces.h"
-#include "header.h"
 #include "path.h"
+#include "perf-libelf.h"
+#include "strlist.h"
+#include "symbol.h"
+#include "symsrc.h"
+#include "util.h" // lsdir()
+
+#include <linux/capability.h>
 #include <linux/ctype.h>
+#include <linux/kernel.h>
 #include <linux/log2.h>
+#include <linux/mman.h>
+#include <linux/string.h>
+#include <linux/time64.h>
 #include <linux/zalloc.h>
 
 #include <elf.h>
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 42d8e3fd1d01..d37d5a97bc6f 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -153,10 +153,6 @@ int symbol__config_symfs(const struct option *opt __maybe_unused,
 
 struct symsrc;
 
-#ifdef HAVE_LIBBFD_SUPPORT
-int dso__load_bfd_symbols(struct dso *dso, const char *debugfile);
-#endif
-
 int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss,
 		  struct symsrc *runtime_ss, int kmodule);
 int dso__synthesize_plt_symbols(struct dso *dso, struct symsrc *ss);
-- 
2.52.0.rc2.455.g230fcf2819-goog


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ