Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4462463rdb; Mon, 11 Dec 2023 23:06:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFCRS6c8PfzevcDpCYG5/vO0/6qauG6F3P8Jo2izFGqStqtC7Qr8LTBjJ25kEVt3KCDxFhm X-Received: by 2002:a05:6870:bb16:b0:1fa:1c89:c656 with SMTP id nw22-20020a056870bb1600b001fa1c89c656mr6877863oab.56.1702364782277; Mon, 11 Dec 2023 23:06:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702364782; cv=none; d=google.com; s=arc-20160816; b=vKSTcfgICDx4i6BjTsEOrU6RyU44owCnsw6wEtDV8BX1q8297W1M3ngUqMf5ak35nl blpT1FJ2sOQeEbleuMivhvKZ+7923goTuwD0XCcgOjrVZLcK1CoX1uUUi6IyATFmntP8 7lgLKP2YeSqrhwWzuzN3DAjeL7TPlBRSWfSy/Qh6wbOrXdCrTSkKZZ3M7DxzbpLWwkFE 1pw7sq8oCX9Az+dvRReXMyw4jM5QayGN+GMfIEArRPO70aLWMBxvDU7hWzIaF6IY/1Xy Q7CqAWTnVTRkHi+zJWzaK7LzaFryKXmGahKxL1ZdhAcCKAzgj96SCBy4MCRN988Su/p+ c7NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=h7MmpZWXIj03M3uDOilYQIEOcQY8xZL0V5IuLXoT63s=; fh=j7XGxNx2Lg8u7nyGj/Zu18oEzBtLERie2+5jwGMgLi0=; b=WFUabOicoAQO1oe4OkZKPoYcNXfZ4rC/krpm7ZeCWbwQufgf+zvRcW0Rl7UkQyCKAq KeRp0Ec0CKPhUP1bcIxaHgwnVmA7f5TwylENzcGPYFbMNTSH9foH3RC7EMYx4aKbThjG XSAYdQguvn1qkpCb4vMB9vEaLZ3Rdy1J1g5CRdzbYXTYFe6FAYLmOxfUOwCfIO0dQATY 7lnx7t423mfdHkH3eeINCasfOFUjpSF4saiiqdLojlZ9JuPDdS4k4o1edTxi9UMBEoTX gpe4E+hXPim9CBzksj6Q1J64QjnL6oUEpzR8sqKt31Z1F6dfxY+Iquy4xexTH+PNp7KB o66Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eCK+ZX0P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id by26-20020a056a02059a00b005c65defc400si7630458pgb.624.2023.12.11.23.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 23:06:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=eCK+ZX0P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id A9842805B2E9; Mon, 11 Dec 2023 23:06:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230340AbjLLHFz (ORCPT + 99 others); Tue, 12 Dec 2023 02:05:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230360AbjLLHFr (ORCPT ); Tue, 12 Dec 2023 02:05:47 -0500 Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28ADAD0; Mon, 11 Dec 2023 23:05:54 -0800 (PST) Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-590b3337d2bso2037220eaf.2; Mon, 11 Dec 2023 23:05:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702364753; x=1702969553; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=h7MmpZWXIj03M3uDOilYQIEOcQY8xZL0V5IuLXoT63s=; b=eCK+ZX0PffaP0WcIiHc9Jm86gljP3ACMk8PVUnJTt7QLmLm1iZvRF64/QQwZrhVJcP nKe8+Vwuf813a/zN8l5PyFaA7N0UUiQjJn7QMQMZlEcg3pEmyphLT257V6SGUUNxQQ/k mbN09+shBo2YpUH8LdIFJa3NyBzEAgXtQbEi5b7Ix76x7dHCEXG8A/3qPPeY/iZ1+BQH hfoz9hxKhgBS6bu2Vzet3mt+ZH6Xx13wSGty8ZpuZaiMRhVN3vUgEAiD3N47zNfmrBxv YN8lY61SkrYRWN92zNiJRrumEiPxqsYeB4PdxsKXiM/a4IwaSFrqtGuJ0fomZRy00hHR W20w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702364753; x=1702969553; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=h7MmpZWXIj03M3uDOilYQIEOcQY8xZL0V5IuLXoT63s=; b=W3HwC3nrbUO+FQbsY9jJa1Q8R4LQIxnv5PuCuUWc8IAYraLJGDMhER4Yw1U2kcCigy IpSJY2BK/+uzve+wD++yfxul86S/uVsYToOVXDz/s5h0LkofSKNW9nXWJgV6Gk2ruHUs tDgxPE+CglonJn26K1uih9hSNV6QpYv71H/SCYU6BWbURBZuGgyY9js9yL0SYw3VdTjK TbPFGCOxY9hGti5vVra609Ue+1oBOwsimRMVmPg+4dLBqovpnhAgX8ofgnK8qSI6WOXz 9o36BdZ4TFeAFe2/1jmIfke0pQI38LtdOmvjIJWm0k9XlWM+KY21schujeGjKlpBEYY1 9NTg== X-Gm-Message-State: AOJu0YzGgHjtgde3pM3ymt/W1UnMOb54TvTjF2CvaQHj25q+FyefthsZ r1e2o0FCd4JebmH0tVzO33w= X-Received: by 2002:a05:6358:6f93:b0:170:f1ab:9612 with SMTP id s19-20020a0563586f9300b00170f1ab9612mr7264rwn.65.1702364753280; Mon, 11 Dec 2023 23:05:53 -0800 (PST) Received: from bangji.hsd1.ca.comcast.net ([2601:647:6780:42e0:7da0:5ec4:de63:3cf4]) by smtp.gmail.com with ESMTPSA id g17-20020a056a0023d100b006cb6e83bf7fsm7397491pfc.192.2023.12.11.23.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 23:05:53 -0800 (PST) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ian Rogers , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Milian Wolff , Pablo Galindo , Fangrui Song Subject: [PATCH 3/3] perf unwind-libunwind: Fix base address for .eh_frame Date: Mon, 11 Dec 2023 23:05:46 -0800 Message-ID: <20231212070547.612536-4-namhyung@kernel.org> X-Mailer: git-send-email 2.43.0.472.g3155946c3a-goog In-Reply-To: <20231212070547.612536-1-namhyung@kernel.org> References: <20231212070547.612536-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 11 Dec 2023 23:06:19 -0800 (PST) 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: dc2cf4ca866f ("perf unwind: Fix segbase for ld.lld linked objects") Signed-off-by: Namhyung Kim --- 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 c0641882fd2f..5e5c3395a499 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(thread__maps(ui->thread), map_node) { struct map *map = map_node->map; - u64 start = map__start(map); + u64 start = map__start(map) - map__pgoff(map); if (map__dso(map) == dso && start < base_addr) base_addr = start; -- 2.43.0.472.g3155946c3a-goog