Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754137AbcJMLBr (ORCPT ); Thu, 13 Oct 2016 07:01:47 -0400 Received: from mail-qk0-f176.google.com ([209.85.220.176]:34507 "EHLO mail-qk0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753700AbcJMLB2 (ORCPT ); Thu, 13 Oct 2016 07:01:28 -0400 From: Stephane Eranian To: linux-kernel@vger.kernel.org Cc: acme@kernel.org, jolsa@redhat.com, peterz@infradead.org, mingo@elte.hu, anton@ozlabs.org, namhyung@kernel.org, Stefano Sanfilippo , Ross McIlroy Subject: [PATCH 5/9] perf/jit: do not assume pgoff is zero Date: Thu, 13 Oct 2016 03:59:39 -0700 Message-Id: <1476356383-30100-6-git-send-email-eranian@google.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476356383-30100-1-git-send-email-eranian@google.com> References: <1476356383-30100-1-git-send-email-eranian@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1359 Lines: 33 From: Stefano Sanfilippo 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 Signed-off-by: Ross McIlroy Reviewed-by: Stephane Eranian --- tools/perf/util/unwind-libunwind-local.c | 4 ++-- 1 file 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, -- 1.9.1