aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2011-08-24 02:40:14 -0400
committerHerton Ronaldo Krzesinski <herton.krzesinski@canonical.com>2011-10-17 13:33:15 -0400
commita90a547539f946d2bfcf3ff71ee7d7a5babea752 (patch)
treec04788f922b426979c90daea961088f0bc4148e4 /tools/perf
parent2820d5310b3f2659f4eb2791574350f640dd2bdb (diff)
perf symbols: Fix ppc64 SEGV in dso__load_sym with debuginfo files
BugLink: http://bugs.launchpad.net/bugs/868628 commit adb091846318f86e4f46c7d6a7b40d2f478abdbe upstream. 64bit PowerPC debuginfo files have an empty function descriptor section. I hit a SEGV when perf tried to use this section for symbol resolution. To fix this we need to check the section is valid and we can do this by checking for type SHT_PROGBITS. Cc: <stable@kernel.org> Cc: Ingo Molnar <mingo@elte.hu> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Eric B Munson <emunson@mgebm.net> Link: http://lkml.kernel.org/r/20110824065242.895239970@samba.org Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/symbol.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index eec196329fd..40fd1c7c38a 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1111,6 +1111,8 @@ static int dso__load_sym(struct dso *dso, struct map *map, const char *name,
1111 } 1111 }
1112 1112
1113 opdsec = elf_section_by_name(elf, &ehdr, &opdshdr, ".opd", &opdidx); 1113 opdsec = elf_section_by_name(elf, &ehdr, &opdshdr, ".opd", &opdidx);
1114 if (opdshdr.sh_type != SHT_PROGBITS)
1115 opdsec = NULL;
1114 if (opdsec) 1116 if (opdsec)
1115 opddata = elf_rawdata(opdsec, NULL); 1117 opddata = elf_rawdata(opdsec, NULL);
1116 1118