diff options
author | Stefano Sanfilippo <[email protected]> | 2016-10-13 03:59:39 -0700 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2016-10-24 11:07:39 -0300 |
commit | eac05af2bf33aa9474482f1f19555adfd2cdf69d (patch) | |
tree | 3fedff670be6b35dd6cd4aef0b97e7598e645b54 | |
parent | 7354ec7a86c0cc03bebb7f86af8f20a88b27c262 (diff) |
perf jit: Do not assume pgoff is zero
When calculating .eh_frame_hdr base and LUT offsets do not always assume
that pgoff is zero.
The assumption is false for DSOs built from the jitdump by perf inject,
because the ELF header did not exist in memory at sampling time.
Signed-off-by: Stefano Sanfilippo <[email protected]>
Signed-off-by: Ross McIlroy <[email protected]>
Reviewed-by: Stephane Eranian <[email protected]>
Cc: Anton Blanchard <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[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/unwind-libunwind-local.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c index 20c2e5743903..6fec84dff3f7 100644 --- a/tools/perf/util/unwind-libunwind-local.c +++ b/tools/perf/util/unwind-libunwind-local.c @@ -357,8 +357,8 @@ find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, di.format = UNW_INFO_FORMAT_REMOTE_TABLE; di.start_ip = map->start; di.end_ip = map->end; - di.u.rti.segbase = map->start + segbase; - di.u.rti.table_data = map->start + table_data; + di.u.rti.segbase = map->start + segbase - map->pgoff; + di.u.rti.table_data = map->start + table_data - map->pgoff; di.u.rti.table_len = fde_count * sizeof(struct table_entry) / sizeof(unw_word_t); ret = dwarf_search_unwind_table(as, ip, &di, pi, |