perf symbols: Move bfd_demangle stubbing to its only user
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 24 Nov 2014 20:10:52 +0000 (17:10 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 24 Nov 2014 21:03:47 +0000 (18:03 -0300)
commitaaba4e12a99cc56fc8614a3f2a3ec6db4fcde76e
treea86d9524dbeb1ca301d62668641183ea3f1d195f
parent23f0981bbd89fcc1496d0490ec39ca7c91599e32
perf symbols: Move bfd_demangle stubbing to its only user

We need to define bfd_demangle() to either a wrapper for
cplus_demangle() or to a stub when NO_DEMANGLE is defined.

That is at odds with using bfd.h for some other reason, as it defines
bfd_demangle() and then if code that wants to use symbol.h, where the
above stubbing/wrapping is done, and bfd.h for other reasons, we end up
with a build error where bfd_demangle() is found to be redefined.

Avoid that by moving the stubbing/wrapping to symbol-elf.c, that is the
only user of such function. If we ever get to a point where there are
more valid users, we can then introduce a header for that.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-6wzjpe2fy9xtgchshulixlzw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/symbol-elf.c
tools/perf/util/symbol.h