Browse files

perf symbols: Fix ppc64 SEGV in dso__load_sym with debuginfo files

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: <>
Cc: Ingo Molnar <>
Cc: Paul Mackerras <>
Cc: Peter Zijlstra <>
Cc: Eric B Munson <>
Signed-off-by: Anton Blanchard <>
Signed-off-by: Arnaldo Carvalho de Melo <>
Signed-off-by: Greg Kroah-Hartman <>
  • Loading branch information...
1 parent 99904bf commit 8413239bfc9e8b94af509c7a43c7d92bd8965630 @antonblanchard antonblanchard committed with gregkh Aug 24, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 tools/perf/util/symbol.c
2 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);

0 comments on commit 8413239

Please sign in to comment.