Skip to contentSkip to conversation

perf_counter tools: Provide default bfd_demangle() function in case it's not around

tip:perfcounters/urgent tip-bot for Ingo Molnar 1 participant 1 message Aug 4, 2009 perf events

lore
Share & tools
lore
#0 lore raw
Commit-ID:  238762507bb41689df191160ada1986b012b57df
Gitweb:     http://git.kernel.org/tip/238762507bb41689df191160ada1986b012b57df
Author:     Ingo Molnar <[email protected]>
AuthorDate: Tue, 4 Aug 2009 13:27:41 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 4 Aug 2009 13:27:43 +0200

perf_counter tools: Provide default bfd_demangle() function in case it's not around

Provide weak alias (which does nothing) in case the system does not offer one.

Cc: Peter Zijlstra <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
LKML-Reference: <new-submission>

---
 tools/perf/util/symbol.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
tools/perf/util/symbol.c +11 -0
index b4fe057..7bd5128 100644
@@ -8,6 +8,17 @@
 #include <elf.h>
 #include <bfd.h>
 
+/*
+ * Weak wrapper in case a library version is not available:
+ */
+extern char * __attribute__((weak)) bfd_demangle (bfd *, const char *, int);
+
+char * __attribute__((weak))
+ bfd_demangle (bfd *bfd __used, const char *name __used, int flags __used)
+{
+	return NULL;
+}
+
 const char *sym_hist_filter;
 
 #ifndef DMGL_PARAMS