Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp37332rwd; Fri, 19 May 2023 15:01:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4DxHkP6G9a/dA0YRWe9vS1k85zK56sL8TOPTzRpvKa6PXwMQivtBbq/0DmotoM8gVlFH6A X-Received: by 2002:a17:902:c402:b0:1ac:b259:87ea with SMTP id k2-20020a170902c40200b001acb25987eamr5942047plk.0.1684533707097; Fri, 19 May 2023 15:01:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684533707; cv=none; d=google.com; s=arc-20160816; b=MAbstN8qnpx7xfpim09265kQCRBEOBKVQRFgD7dfTh967uAfH5+tqKuI0qdeNrZKL0 R3qe6se7UFx8raxry5aVHnDyUVh0SCVpbmSoG2b4FKlS9AHzy0t1GQkRmp6Ufw1HuK+W QYwEBd9Q1U59QV0D5Pk7MD8M43jG8kLP0bJW7VqFtoZDLcvuAF7kWtRcQ+NvGgY835f6 PfuMNiU7KKoN0hXXW9uhts9cbCc4l7ZHNHGHGg1R5WkV640jPOzaPGdIJsNTJ1d4iUDk kC2miq1hzCk+gu6UmP4WUZQTuyLaWHnZP5TIdmAP2mWNuSSBYdOaDJ//7FjWOiKLkKP6 lbvw== 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 :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=4uXFG3N07SM/6noHGA5ZD0BhWKs4fe06jSmLKiYiFpA=; b=lGrfcuFB7KItvojzmYhRbvGZ8tgFJSO2gjZNe+rAtVjeJR2e6+h4C2njYAr8N1Nogd pf2NdiskAdmy5lelGcDiHF4AmyWjU0XX6eWl7dovrv9KMnULV6g7iYaTIkUF1Wbstj/T FKwa4YcGtPb4epBfPL9sFZX3MQZMkGgNUNEB0ZYrsPlZZCFqT3N6qAj3Ymg1OHyHp+oQ N3yNCZMu9TYn8u+kvA0qCF0GZ34Ys4E5IMLL5mqmr+8gIXVGbnSsL8oJ/Pg0NAwpxakx iNsSHJv1wD7WHxEIAmUcUYhuMuD+Um/SxK0T7hp7zJtgjVpE7/F+MKh9eeo3Pu2dcW9T p13A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=qi8xAHod; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n7-20020a170902e54700b001aafb271d16si174427plf.461.2023.05.19.15.01.32; Fri, 19 May 2023 15:01:47 -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=@dabbelt-com.20221208.gappssmtp.com header.s=20221208 header.b=qi8xAHod; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231290AbjESVzf (ORCPT + 99 others); Fri, 19 May 2023 17:55:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbjESVze (ORCPT ); Fri, 19 May 2023 17:55:34 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2ACC1B4 for ; Fri, 19 May 2023 14:55:29 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1ae615d5018so22361535ad.1 for ; Fri, 19 May 2023 14:55:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20221208.gappssmtp.com; s=20221208; t=1684533329; x=1687125329; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:from:to:cc:subject:date:message-id :reply-to; bh=4uXFG3N07SM/6noHGA5ZD0BhWKs4fe06jSmLKiYiFpA=; b=qi8xAHodXi1tTUlxkODdWEQyiAwma/a9BvGcwY/aQkz6Qrfgd/uYwIsQ3ftgzEUzB7 gQPnW4y98zBiQ1VJR1u1WmO0yXGgMdTnoKC4h1pdaN0elORWUcBRgyEH9K9ragANYapi wvIqmSO9V822mFO1HA5NixmIP6q/D+Q5AwrBbbtETBnZBo3FeUikHs11UulsM7CkjzDJ J8h6sS8sJhSFcDl/4uQ/P1JP35ibHi6+NnvdLdBO39EeIwkui0FYW8krsRQlEj+OcJaT 1EkX2USheSSzI+PFRacvW1yO7xokuC0lKYP8KIO4GPA1Hd/ORj085Er5URM/OrxF27lc 9Zbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684533329; x=1687125329; h=content-transfer-encoding:mime-version:message-id:to:from:cc :in-reply-to:subject:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4uXFG3N07SM/6noHGA5ZD0BhWKs4fe06jSmLKiYiFpA=; b=FXkK7NWFWanCG/XS+smQAMRkT++U43MC+tla+Y85TxqvJ+l7rmkfIEAUclEGu2eqvB ZG5+/kn0+/k/RRL/mmR7vTaS8z06FE8G7Fg3JTTHXJNB3SczflCbv0LjTzrQJlJZu2Rm jb4A2rJ12eGYHae15p+U3Q92oUriRYMfRb3UWsuyjMfxd29x4FMXsoLU3rNcMsX2RT7/ 23rgTs/q8ebvPjP0dr8JpHXONyZ2k/0XKbZ3+K/ERcKWNZwf0Wn0rl9RG3j5RnICwUfS gDZFulIDhgCGySUnH8MN2b0l5uDlUxOxvH4xIqYqIQA2w0lyZBhCYSrYU7Wl7AerT74x vaMw== X-Gm-Message-State: AC+VfDzcH/fcvMlbAfaLkSKrOxR+pPLeSB6ZUwyigumWyeuZzMwpiz+t 9HwKEs5TXPCK1IaBlyRn19ajrA== X-Received: by 2002:a17:902:e746:b0:1aa:df9e:2d19 with SMTP id p6-20020a170902e74600b001aadf9e2d19mr4239865plf.54.1684533329317; Fri, 19 May 2023 14:55:29 -0700 (PDT) Received: from localhost ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id g23-20020a170902869700b001a98f844e60sm80031plo.263.2023.05.19.14.55.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 May 2023 14:55:28 -0700 (PDT) Date: Fri, 19 May 2023 14:55:28 -0700 (PDT) X-Google-Original-Date: Fri, 19 May 2023 14:55:05 PDT (-0700) Subject: Re: [PATCH v8 1/3] riscv: Introduce CONFIG_RELOCATABLE In-Reply-To: <87sfbsvvp0.fsf@igel.home> CC: alex@ghiti.fr, alexghiti@rivosinc.com, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, Paul Walmsley , aou@eecs.berkeley.edu, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org From: Palmer Dabbelt To: schwab@linux-m68k.org Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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, 19 May 2023 14:48:59 PDT (-0700), schwab@linux-m68k.org wrote: > On Mai 19 2023, Alexandre Ghiti wrote: > >> I have tested the following patch successfully, can you give it a try >> while I make sure this is the only place I forgot to add the -fno-pie >> flag? >> >> diff --git a/arch/riscv/kernel/Makefile b/arch/riscv/kernel/Makefile >> index fbdccc21418a..153864e4f399 100644 >> --- a/arch/riscv/kernel/Makefile >> +++ b/arch/riscv/kernel/Makefile >> @@ -23,6 +23,10 @@ ifdef CONFIG_FTRACE >>  CFLAGS_REMOVE_alternative.o = $(CC_FLAGS_FTRACE) >>  CFLAGS_REMOVE_cpufeature.o = $(CC_FLAGS_FTRACE) >>  endif >> +ifdef CONFIG_RELOCATABLE >> +CFLAGS_alternative.o += -fno-pie >> +CFLAGS_cpufeature.o += -fno-pie >> +endif >>  ifdef CONFIG_KASAN >>  KASAN_SANITIZE_alternative.o := n >>  KASAN_SANITIZE_cpufeature.o := n > > I can confirm that this fixes the crash. Thanks. Alex: can you send a patch?