Skip to content

Commit

Permalink
perf symbols: Fix ppc64 SEGV in dso__load_sym with debuginfo files
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Anton Blanchard authored and Arnaldo Carvalho de Melo committed Sep 23, 2011
1 parent f66fedc commit adb0918
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/perf/util/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit adb0918

Please sign in to comment.