diff options
author | Cody P Schafer <[email protected]> | 2012-08-10 15:22:51 -0700 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2012-08-13 12:56:45 -0300 |
commit | 52f9ddba516214a59fdd8eb155b2583ab314dc31 (patch) | |
tree | 349c99f8da86809fd778f33e01465b85299d8dd0 | |
parent | 0f75a710dfd8fd5cd9e558e3f26c474c8fa63e3c (diff) |
perf symbols: Don't try to synthesize plt without dynstr
If .dynsym exists but .dynstr is empty (NO_BITS or size==0), a segfault
occurs. Avoid this by checking that .dynstr is not empty.
Signed-off-by: Cody P Schafer <[email protected]>
Cc: David Hansen <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Matt Hellsley <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Sukadev Bhattiprolu <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r-- | tools/perf/util/symbol-elf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index e0376094fa8b..a2e994e2605f 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -232,6 +232,9 @@ int dso__synthesize_plt_symbols(struct dso *dso, char *name, struct map *map, if (symstrs == NULL) goto out_elf_end; + if (symstrs->d_size == 0) + goto out_elf_end; + nr_rel_entries = shdr_rel_plt.sh_size / shdr_rel_plt.sh_entsize; plt_offset = shdr_plt.sh_offset; |