Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4821213rdb; Tue, 12 Dec 2023 10:08:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IEjg2w1gJlGvylHIQztY5vHka1ITp8N0rSLpfgx3LMYdfPjkYF/cmjOIkTWXaIf/AEOt0Be X-Received: by 2002:a17:903:22cc:b0:1d0:a53e:263a with SMTP id y12-20020a17090322cc00b001d0a53e263amr3436534plg.109.1702404503744; Tue, 12 Dec 2023 10:08:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702404503; cv=none; d=google.com; s=arc-20160816; b=M1FjgC7FgtwqPXJhm2w+vA2amCDuwF2xsSyWTVK4Sbg8j+SkGuVlu+/RICCSrN2Hp8 5vFG5+O2VaXZGuYIWyCF+W2qLHb+1kc5wzMuJ8+DRGHz2jG84ZwM1WeldX/dfePNMxY8 uLSr6VZvT03aq1cw9dDgRfCaq+vnX/scaW+35cL9VWJQZ6Az2OIhGAupBzFZUc0qrE/H JAeT+E5aOZYYjzj4Nod6p/mB43xMx4PPPMcMszp3O6BpN0/T1091pzQfRtmnnxcsjQBX 8QouzEnE6LJRo0r2V2v0HqgXjP1NzGVlevENBSCgCVh6e+2lNyMkXcbv44KvJL3KCN1I oZTQ== 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=VhYdf+8cQfQ3MBTe94vw2YkuW7rtXoDUvtiEUFEToaQ=; fh=gbRfs4Y5vnVImbARvTpg01BxMh7cDiEnWtMIRe61H1s=; b=umvt0z7m30Sh9KhU/W29RZiajuupMWzwH8IQYcjG32JW3ZjwCZJwg0dy945aapRhLr rF76q/IIZExPb/Tn3TwQBLWOd8Jm12mQzHdwpImqgeznh9mrc9flZObdtQDDMDQRrog7 zFgFrlQW/5bvLyEgZVF735nieuaNW7JLh7kEhMnbj/JEHoCxQC9yM8VTM8eEqprLH+oG TMLR9m3r0Nv/dQ0db2z868HklH/HVj9BfMxFRSQ8R4u98JW6DfskEgL/HVVosXEtFj5s i9oXv+Zpm70NGXPojZbzCR8ARFXvLrqWqppNUX9iaSA2zJiVuESMISUsyweRh0aagTzJ Q2DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=WuDYgIxE; 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 l21-20020a170902d35500b001d09b00de2asi5984513plk.587.2023.12.12.10.08.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 10:08:23 -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=WuDYgIxE; 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 6F4B280D1EFE; Tue, 12 Dec 2023 10:08:21 -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 S1377067AbjLLSIH (ORCPT + 99 others); Tue, 12 Dec 2023 13:08:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377081AbjLLSIG (ORCPT ); Tue, 12 Dec 2023 13:08:06 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 961DBCA for ; Tue, 12 Dec 2023 10:08:12 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40c3963f9fcso2985e9.1 for ; Tue, 12 Dec 2023 10:08:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1702404491; x=1703009291; 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=VhYdf+8cQfQ3MBTe94vw2YkuW7rtXoDUvtiEUFEToaQ=; b=WuDYgIxEwZyV86F+YyWEX3X8tT0gogswv5nuOtTCuS+TCMheELgY9+CrcDV2A++ptJ XhFBSApt1S1BPbvn872zL1+PXMPwyFpgrw/7sWt9uB37qdK+tI1g1f2IKbOisvogtzXV 4hG3yLHHvHMNbqRAOrGdkAYY8EwrHKxpUHG59Ka+XB6XT9Gx6kLQ8n1WcQL2SJ6S9nmP JhDAaS379pfjHMlRjti8wdUYlE/hoIITOlidzrUJp4hqWzTSnjtERAdZy6t++BHV98dm dU0slBlQgl6L8MTlpXwF2iD/u/17wfRGgB8/nkp/+hVNfMGyKsBMvrkaDBYnj1JvFVqa 2AMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702404491; x=1703009291; 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=VhYdf+8cQfQ3MBTe94vw2YkuW7rtXoDUvtiEUFEToaQ=; b=q9q+2CHMQcSUFTVArfUzV5gDhjfnUOAMQcI1eqDPdDLUCEz/a0kj1iYlKZILYCu7Ee 3zXR19eY40gyvXIEUpaUOCrCUTHaOOSXzL46qSF1/STQgHEsF5B6v3EkvClvb+4Znamk OnhmF0He5OWGfCtB/F/JdP3QwBoH7vYn5gBcWIGpRkwMp9ZmsCK6b9al2+/42hzsea8b eOyqxPWE+VKWBbO4dE5QQnrZ8qnBMhihQaoNdRyHJF8RPjV0002maMyx2b+4M11dhQBa WMob4eX7E8dUfe9RM08RjmMJNnn3SaUGKJRS0BGaldJYp8XP/c1EQXDsB2mngmQ7nEv1 N8cw== X-Gm-Message-State: AOJu0YzZx3W+IkgNvXajstKxro2l/L7glKrC6y5/hqe+g8UEk6Y6ZSVL HYUcwEXDDP845TJdeIC+RujjS21UglXtVVm2l3Dqsg== X-Received: by 2002:a05:600c:3648:b0:3f7:3e85:36a with SMTP id y8-20020a05600c364800b003f73e85036amr324700wmq.7.1702404490911; Tue, 12 Dec 2023 10:08:10 -0800 (PST) MIME-Version: 1.0 References: <20231212070547.612536-1-namhyung@kernel.org> <20231212070547.612536-2-namhyung@kernel.org> In-Reply-To: <20231212070547.612536-2-namhyung@kernel.org> From: Ian Rogers Date: Tue, 12 Dec 2023 10:07:59 -0800 Message-ID: Subject: Re: [PATCH 1/3] perf genelf: Set ELF program header addresses properly 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:21 -0800 (PST) On Mon, Dec 11, 2023 at 11:05=E2=80=AFPM Namhyung Kim = wrote: > > The text section starts after the ELF headers so PHDR.p_vaddr and > others should have the correct addresses. > > Fixes: babd04386b1d ("perf jit: Include program header in ELF files") > Signed-off-by: Namhyung Kim Reviewed-by: Ian Rogers Thanks, Ian > --- > tools/perf/util/genelf.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tools/perf/util/genelf.c b/tools/perf/util/genelf.c > index fefc72066c4e..ac17a3cb59dc 100644 > --- a/tools/perf/util/genelf.c > +++ b/tools/perf/util/genelf.c > @@ -293,9 +293,9 @@ jit_write_elf(int fd, uint64_t load_addr, const char = *sym, > */ > phdr =3D elf_newphdr(e, 1); > phdr[0].p_type =3D PT_LOAD; > - phdr[0].p_offset =3D 0; > - phdr[0].p_vaddr =3D 0; > - phdr[0].p_paddr =3D 0; > + phdr[0].p_offset =3D GEN_ELF_TEXT_OFFSET; > + phdr[0].p_vaddr =3D GEN_ELF_TEXT_OFFSET; > + phdr[0].p_paddr =3D GEN_ELF_TEXT_OFFSET; > phdr[0].p_filesz =3D csize; > phdr[0].p_memsz =3D csize; > phdr[0].p_flags =3D PF_X | PF_R; > -- > 2.43.0.472.g3155946c3a-goog >