Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6503220rwl; Wed, 22 Mar 2023 11:26:45 -0700 (PDT) X-Google-Smtp-Source: AK7set8Qb9wZV1AUFSFCxYC5b5xNJPakUPczUmaApjlBRVJ150LPHJTfoh4D43eNNfDQDZllHm06 X-Received: by 2002:a17:90b:3b46:b0:23f:58d6:b532 with SMTP id ot6-20020a17090b3b4600b0023f58d6b532mr4984623pjb.5.1679509605365; Wed, 22 Mar 2023 11:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679509605; cv=none; d=google.com; s=arc-20160816; b=OPsK1C8oDWyyntpZRFjdM1tgmj65xcl82uOYyApjXKJAgFQKRtNdPLvJ0fjx5mQQ7m wM4TyTYy1iyMQVGQDXmIxoN45LVcLrqD/8YKTyeNVhw+xCpghLlYz590x5I/3Jjb8fp8 Q9RPAQJLewl7PGPiqDRHQG3SNUZ7mwdrMXaRElwR/pD5lOSLtElbqz1FDnnZzYRZ14rH 6rokvHfRanZMm2zFjxZPs620wa1bocQ/YWjezpY32KRdxXQqnF1V8lSmi5P6gLYVYE67 NT/2nlAoJERi8q8eBN/ppaEp/ftewNlvGz2qDPVxzz9lycj2olxnecUk5w3hsk7UWpkb U8Gw== 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=Xai25ViACOhtMbP/9A/HIC69Te+6jb14im4nmgBreX0=; b=tGnxX8EK1NGrhbfulvxZEjUROHDqWg1+HnwfnLzxDOAvX36hmtAQE3vz65sKjsLNE8 VJTmyhCh+vRjBGwLTx6Z/HJ7jMDYPCZuqP+FaQ5fO6iGctDA3RmGBKOXjW5AQT3kv+35 tS1zujC/BlD7SRMIMiNcJH3NRPuz9uCIX2LmfPGv8DRJJOP7EbWf7Zai3eTH+bAWPJSF uVvGgyeVvy6gEj7qVsYn0gaUn6GTOdG+zTD3tuijhM4cUaB6dDB77jZMjWlIc7k+LS9M Har7lfjrd5WzzBLfaoB/Rw90VshehiurCcWFJGJHdQ8aG/dTDAG7G2oIhGqdsMdliDbD 0v+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Nc7bqPWv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n17-20020a170902d2d100b001a1e867f27fsi4225977plc.593.2023.03.22.11.26.33; Wed, 22 Mar 2023 11:26:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Nc7bqPWv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230454AbjCVS0G (ORCPT + 99 others); Wed, 22 Mar 2023 14:26:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230408AbjCVS0F (ORCPT ); Wed, 22 Mar 2023 14:26:05 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88D4865059 for ; Wed, 22 Mar 2023 11:25:57 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id d13so19335196pjh.0 for ; Wed, 22 Mar 2023 11:25:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679509557; 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=Xai25ViACOhtMbP/9A/HIC69Te+6jb14im4nmgBreX0=; b=Nc7bqPWvvVP0Fh9GRUREatEuPhbNWcj8ydyJq6p7WhnKTmZsmINp40U8jm2U/D3eOh GiADNrvpDW1src3wBD86k8hybLw++0LHdLBlze0Q290ZO1ycLMYXpjqhF0bC849Amhtk Uy0gNTTczAqnmq7Ne1eUnCmgjRAczfqeQ58RKE9Z1Dbo8WYhXCE+35mHwpNTZjinRv7Z SvFY91A1LyC+CNVJab3PMehak5rGBLhjGTsCzg52VkGZ8uMK06Y5GA1JlP2dh0NN6NWH L5Jzlk3GH1BS4NTePFlNBmFvEFZSn5SfhLcK85z0+yzixjDvudD4Wt6pqVVnBBIsUYXI dcEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679509557; 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=Xai25ViACOhtMbP/9A/HIC69Te+6jb14im4nmgBreX0=; b=2xtMnsaGuCAs+Tf3gKNdx+FoBpAAp1Ti18vs1FIDHVQ1KyJWtZ3JXCBCKy1krg0NJd iFnD9u2Orak7A0SMQ/vi8SQ5AITEOSiobNI3McWcogf2ywMxSihEtspzprHjZUgfwLmX kOIU5q37kRKufqUMJVPlIHgsnb4UN3gmNvS6tARV4x2onKiBMMiPzzPTVfcd7s2yfnOz ok3a/0zVOpZMuTVL5F+s8qzUp/OaRQ9x99sQfmWbpaopkeo7WuxR6SkfYMQEynaIonM3 mrwUZeiW/tPf58RJv/w6HQCcsnOT7JvByESM3hiutRiNH3y0bZvurr7Tsvj4vGyzx7dM fI/A== X-Gm-Message-State: AO0yUKWsuMIpQh95Jo7Ks5C0ymtesZmmCPZM1ZpBnpI5+NBb1gB/+ctM M2h/VZo/IE5bqqZohIgTSeRFzsrjTxR1th8dp8YHqw== X-Received: by 2002:a17:902:7b8b:b0:19a:82a2:fcf9 with SMTP id w11-20020a1709027b8b00b0019a82a2fcf9mr1399015pll.2.1679509556719; Wed, 22 Mar 2023 11:25:56 -0700 (PDT) MIME-Version: 1.0 References: <20230215143626.453491-1-alexghiti@rivosinc.com> <20230215143626.453491-2-alexghiti@rivosinc.com> <4a6fc7a3-9697-a49b-0941-97f32194b0d7@ghiti.fr> <877cw7dphf.fsf@all.your.base.are.belong.to.us> In-Reply-To: <877cw7dphf.fsf@all.your.base.are.belong.to.us> From: Nick Desaulniers Date: Wed, 22 Mar 2023 11:25:45 -0700 Message-ID: Subject: Re: [PATCH v8 1/3] riscv: Introduce CONFIG_RELOCATABLE To: =?UTF-8?B?QmrDtnJuIFTDtnBlbA==?= Cc: Alexandre Ghiti , Alexandre Ghiti , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Paul Walmsley , Palmer Dabbelt , Albert Ou , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, nathan@kernel.org, linux-kbuild@vger.kernel.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-15.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 24, 2023 at 7:58=E2=80=AFAM Bj=C3=B6rn T=C3=B6pel wrote: > > Alexandre Ghiti writes: > > > +cc linux-kbuild, llvm, Nathan, Nick > > > > On 2/15/23 15:36, Alexandre Ghiti wrote: > >> From: Alexandre Ghiti > >> > > I tried a lot of things, but I struggle to understand, does anyone have > > any idea? FYI, the same problem happens with LLVM. Off the top of my head, no idea. (Maybe as a follow up to this series, I wonder if pursuing ARCH_HAS_RELR for ARCH=3Driscv is worthwhile?) > > Don't ask me *why*, but adding --emit-relocs to your linker flags solves > "the NULL .rela.dyn" both for GCC and LLVM. > > The downside is that you end up with a bunch of .rela cruft in your > vmlinux. There was a patch just this week to use $(OBJCOPY) to strip these from vmlinux (for x86). Looks like x86 uses --emit-relocs for KASLR: https://lore.kernel.org/lkml/20230320121006.4863-1-petr.pavlu@suse.com/ --=20 Thanks, ~Nick Desaulniers