Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4821550rdb; Tue, 12 Dec 2023 10:08:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUar5g4xUrf8Gv2x+tMC+LhOdYzj4u/mhvfkBRYyNNvU9/XjJTkkJ6XVq4qsKwrX2V096j X-Received: by 2002:a05:6a20:8e0e:b0:18d:1321:c28a with SMTP id y14-20020a056a208e0e00b0018d1321c28amr3807966pzj.10.1702404528888; Tue, 12 Dec 2023 10:08:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702404528; cv=none; d=google.com; s=arc-20160816; b=sZ6jQReOamYxG0cYp4Bn4St3IPlNPEovYurbh2hokQAGq0yRmGkFT1ZCZAxLyR+I1S yQ/Zt0CIHlgiT34ADqfkQropjh3sdjrOdrvTxQEYIFUwkDt/WGgD+cd8zhndNEDcFJZj Y3xHCJW8EOvTlsnH6bxQrlRllm8Jkx7tya5JhRRAcNzJtQmYMeC5qXUMZ3Y9U9YuCmhb cAbl6CYkLWgcLYTGkUCnpk1WsSblXxJ0cjDZk52Ib3/lkViQfwDb6m16860lVMHexSnE HMyUF7cJrg5CQXRgmYIayNgQtxuhI9xzxurg18FmCx0AgjXbI/5JzzOAoU7y7Tdr+KgF cBqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Hpk0I1KigXVxBpZ4grAzm0OjYz4EHzBeGwLl/SIDW/0=; fh=gbRfs4Y5vnVImbARvTpg01BxMh7cDiEnWtMIRe61H1s=; b=J3F0C/92Dd3zEFaoKJXj4q7PpNKPwjH3Vw/S93dWGjELeusEpSPcUg8SK+5OpqkUVZ Xw6TMtAJ+WBeoyTXZEyLGcU+D2bUXjfsz2bGAgLTRNUJ+W/vMzyNgZmBB2VirSgzZZxF dg6ndIDCfKmBBrD0oc0r9dRFCrlVkT+iQf/WhiTxBd7lP7fsddMvrgY/HwyvkBDlfoYe /d/S8HhvVscBc8mdV/s/J9q64lV8oQOFOpGGDwvilBvKjOXzk15wdGcVMid/Jm+0d16O TD/VK9QsnFnZ+hZe/wcNbGdc8y4b/NB5+i/jwki9FTGtfN0aoaUbsdaRu2ke+4yZnQo8 0zLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Bg0uoCzh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id a22-20020a656416000000b005b3d703ca05si8110819pgv.780.2023.12.12.10.08.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 10:08:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Bg0uoCzh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 72A7A80D2400; Tue, 12 Dec 2023 10:08:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377072AbjLLSI1 (ORCPT + 99 others); Tue, 12 Dec 2023 13:08:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377064AbjLLSIZ (ORCPT ); Tue, 12 Dec 2023 13:08:25 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3939394 for ; Tue, 12 Dec 2023 10:08:31 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id 2adb3069b0e04-50bf09be81bso156e87.1 for ; Tue, 12 Dec 2023 10:08:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702404509; x=1703009309; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Hpk0I1KigXVxBpZ4grAzm0OjYz4EHzBeGwLl/SIDW/0=; b=Bg0uoCzhmDOfY4WXX8qTnG0J4MgrFdB3BcGqN+/g3BFV0NjyDVu2S/Ydgd6LBnd9lq kvA5aP3dTmpzYTeqCnfxYg+mIu7PjVu08xaDrJ5/R81oYnCc8tetGncToZ5RwewGQr2G hIecZ2B2EMZYkRKdmq03/fMawLyp/Clra4R0jz3OKl7KUpOOMjdBFLRnmbGmHR7TzLhG JfSvGMUkLEY78y7akqdkGKPahCkM8lkJwdqYDducb5bZJWBPXUnn3bOeXNUNsvG5OgNJ hKMXlT3rRstYo9Fy0znuGJmewbX3slm++9r9N4O3itJ2FRJSij5zm2n8e5Fnasuz2P78 IQmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702404509; x=1703009309; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Hpk0I1KigXVxBpZ4grAzm0OjYz4EHzBeGwLl/SIDW/0=; b=ehDdyTBK7H/IjYsFDRk95ejnqoZWQ4v9Ovn0bTFg5HOGopVmuWAPL5hGFiUmAJthlc Q7ptr38KhaSeramz3qQiEzoW0Syw/Kdye/UDznxcIKs/2YTag/95VBezWje41AYkb3zl IKsPaCvuO+nQXY9bTXP/QfhmoOIZ3gKkkOGZZBxKgrBPRKVn5YyGtTI7Cy+emZEzOmaZ jLbCr3X81W/YZs7el8oyR6hglGAcnw58qwWem8S8vEAMWQGokh3a7J4P+srRx1alLzdt hfChnqwqpDSdS4SFCOPI6nMK9EJEQQLjebbmTaHNQ3ljqMZK1YfAKoXoIVbmZvFbeupJ Riiw== X-Gm-Message-State: AOJu0YyuiTMlSzF9E5ELrci11zp0MgAPJaYV3ZCAs1Re7Oqv4Ac1UdWa 1yZGltLMFN1hslBDaN2MTonR/bu+v/1ithnHWrphIA== X-Received: by 2002:a05:6512:539:b0:50c:e19:b658 with SMTP id o25-20020a056512053900b0050c0e19b658mr267201lfc.1.1702404509283; Tue, 12 Dec 2023 10:08:29 -0800 (PST) MIME-Version: 1.0 References: <20231212070547.612536-1-namhyung@kernel.org> <20231212070547.612536-4-namhyung@kernel.org> In-Reply-To: <20231212070547.612536-4-namhyung@kernel.org> From: Ian Rogers Date: Tue, 12 Dec 2023 10:08:18 -0800 Message-ID: Subject: Re: [PATCH 3/3] perf unwind-libunwind: Fix base address for .eh_frame To: Namhyung Kim Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Milian Wolff , Pablo Galindo , Fangrui Song Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Tue, 12 Dec 2023 10:08:46 -0800 (PST) On Mon, Dec 11, 2023 at 11:05=E2=80=AFPM Namhyung Kim = wrote: > > 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 Reviewed-by: Ian Rogers Thanks, Ian > --- > 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/u= nwind-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 =3D map_node->map; > - u64 start =3D map__start(map); > + u64 start =3D map__start(map) - map__pgoff(map); > > if (map__dso(map) =3D=3D dso && start < base_addr) > base_addr =3D start; > -- > 2.43.0.472.g3155946c3a-goog >