From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7142130A58 for ; Wed, 8 May 2024 21:00:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715202058; cv=none; b=JKO9AFmlOSf4SoFmkk6I39Il2TZTYOFNZxT8mdzcrXMu0cQ04aAP5KMv3BpgZfxH39qyNqissqWuYoLq4zD1a7tBE3VKcEWf9Ej94a670ejbS1osBlszVkAp9XA175YI2d8LdoCbYeh+YerO0XPLfKuUbiy8T5uO3t5BTkQ3yOU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715202058; c=relaxed/simple; bh=TAeFf8IARM+7xW/JUWkBWPQ/QZ1kk0bk10CYigI+of8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QMFeT+pl9ih0Zdd57ijOoxw857qnNqHpL2qiDKClszRUIOtet8xmsXht8rQTUQZkqEvTBEF5ImNZVfTRUvPbAeMz4kYqhjiFOraQrAFIPCt3FxsjZd5ueDnPt01VosylLWeGUdex2HPYMCSeqI72IXXfPPbEVZDQOtg4wtmPSE4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BG9C/SO3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BG9C/SO3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0A94C113CC; Wed, 8 May 2024 21:00:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715202058; bh=TAeFf8IARM+7xW/JUWkBWPQ/QZ1kk0bk10CYigI+of8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BG9C/SO32KLsyAt3yDAmFgT2b05+cwXpDFIgE8ksLRJA1f/zRc/zMJoMp0D5ftai1 UJcNZeBz/nPePH/iKPODHXlt0/FnG4bq2f4hLZHdQ7kK+Z38REq7OoeCfVXEuclFlx 6Tb7cSGPEoH0rZXWIf9U/f2CX5fgAq9CcF5aZVJvphB+3poRWUdasTXgjla14VtdwI KkSHsTEZ7laTkWg/dsh24fM0kAjarvB3vY63dUQw2xaMut5VQCxMLFLonZWEd1rYVU 6HFOcv+XfEtY0/lBE2b8FaLdxgmpauPZfCkzbeQGGYrHe3QdsdCB9m86SLsUL8cFTl BgIK4cn9pAN5A== From: Namhyung Kim To: stable@kernel.org, Sasha Levin , Greg Kroah-Hartman Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Pablo Galindo Salgado , stable@vger.kernel.org, Ian Rogers , Adrian Hunter , Fangrui Song , Ingo Molnar , Jiri Olsa , Milian Wolff , Peter Zijlstra , Arnaldo Carvalho de Melo Subject: [PATCH for-v6.1 1/2] perf unwind-libunwind: Fix base address for .eh_frame Date: Wed, 8 May 2024 14:00:55 -0700 Message-ID: <20240508210056.2253626-1-namhyung@kernel.org> X-Mailer: git-send-email 2.45.0.rc1.225.g2a3ae87e7f-goog In-Reply-To: References: Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit [ Upstream commit 4fb54994b2360ab5029ee3a959161f6fe6bbb349 ] The base address of a DSO mapping should start at the start of the file. Usually DSOs are mapped from the pgoff 0 so it doesn't matter when it uses the start of the map address. But generated DSOs for JIT codes doesn't start from the 0 so it should subtract the offset to calculate the .eh_frame table offsets correctly. Fixes: dc2cf4ca866f5715 ("perf unwind: Fix segbase for ld.lld linked objects") Reviewed-by: Ian Rogers Signed-off-by: Namhyung Kim Cc: Adrian Hunter Cc: Fangrui Song Cc: Ingo Molnar Cc: Jiri Olsa Cc: Milian Wolff Cc: Pablo Galindo Cc: Peter Zijlstra Link: https://lore.kernel.org/r/20231212070547.612536-4-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/unwind-libunwind-local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c index 81b6bd6e1536..b276e36e3fb4 100644 --- a/tools/perf/util/unwind-libunwind-local.c +++ b/tools/perf/util/unwind-libunwind-local.c @@ -327,7 +327,7 @@ static int read_unwind_spec_eh_frame(struct dso *dso, struct unwind_info *ui, maps__for_each_entry(ui->thread->maps, map) { if (map->dso == dso && map->start < base_addr) - base_addr = map->start; + base_addr = map->start - map->pgoff; } base_addr -= dso->data.elf_base_addr; /* Address of .eh_frame_hdr */ -- 2.45.0.rc1.225.g2a3ae87e7f-goog