From 3aafe5ae08f2aed378e06d78b207883879d25cbe Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Fri, 10 Aug 2012 15:23:02 -0700 Subject: perf symbols: Use both runtime and debug images We keep both a 'runtime' elf image as well as a 'debug' elf image around and generate symbols by looking at both of these. This eliminates the need for the want_symtab/goto restart mechanism combined with iterating over and reopening the elf images a second time. Also give dso__synthsize_plt_symbols() the runtime image (which has dynsyms) instead of the symbol image (which may only have a symtab and no dynsyms). Previously if a debug image was found all runtime images were ignored. This fixes 2 issues: - Symbol resolution to failure on PowerPC systems with debug symbols installed, as the debug images lack a '.opd' section which contains function descriptors. - On all archs, plt synthesis failed when a debug image was loaded and that debug image lacks a dynsym section while a runtime image has a dynsym section. Assumptions: - If a .opd section exists, it is contained in the highest priority image with a dynsym section. - This generally implies that the debug image lacks a dynsym section (ie: it is marked as NO_BITS). Signed-off-by: Cody P Schafer Cc: David Hansen Cc: Ingo Molnar Cc: Matt Hellsley Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Sukadev Bhattiprolu Link: http://lkml.kernel.org/r/1344637382-22789-17-git-send-email-cody@linux.vnet.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/symbol.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/perf/util/symbol.h') diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 1f3eed21f35..fc4b1e630fd 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -253,6 +253,7 @@ void symsrc__destroy(struct symsrc *ss); int symsrc__init(struct symsrc *ss, struct dso *dso, const char *name, enum dso_binary_type type); bool symsrc__has_symtab(struct symsrc *ss); +bool symsrc__possibly_runtime(struct symsrc *ss); #define DSO__SWAP(dso, type, val) \ ({ \ -- cgit v1.2.3-18-g5258