perf: Fix ppc64 SEGV in dso__load_sym with debuginfo files
PATCH 1/1 perf: 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.
Signed-off-by Anton Blanchard <[email protected]>
Cc <[email protected]>
---
tools/perf/util/symbol.c +2 -0
@@ -1111,6 +1111,8 @@ static int dso__load_sym(struct dso *dso } 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 );
Quoted 10 lines · Anton Blanchard
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.Signed-off-by Anton Blanchard <[email protected]>Cc <[email protected]>
Acked-by Eric B Munson <[email protected]>