From: Anton Blanchard Date: Wed, 24 Aug 2011 06:40:14 +0000 (+1000) Subject: perf symbols: Fix ppc64 SEGV in dso__load_sym with debuginfo files X-Git-Tag: Ubuntu-5.2.0-15.16~19608^2~10 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=adb091846318f86e4f46c7d6a7b40d2f478abdbe;p=mirror_ubuntu-eoan-kernel.git perf symbols: Fix ppc64 SEGV in dso__load_sym with debuginfo files 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: Cc: Ingo Molnar Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Eric B Munson Link: http://lkml.kernel.org/r/20110824065242.895239970@samba.org Signed-off-by: Anton Blanchard Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 469c0264ed29..bb5d32f38af2 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, } opdsec = elf_section_by_name(elf, &ehdr, &opdshdr, ".opd", &opdidx); + if (opdshdr.sh_type != SHT_PROGBITS) + opdsec = NULL; if (opdsec) opddata = elf_rawdata(opdsec, NULL);