Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp28500rwd; Fri, 19 May 2023 14:51:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6uTs17uklDyHZJ5L+vmfBVWilrb0/K4+hpsi6QCxNsj2QBRHq81ZaewknTC309eUMlcZTT X-Received: by 2002:a05:6a20:d90b:b0:105:dafa:fec2 with SMTP id jd11-20020a056a20d90b00b00105dafafec2mr2810975pzb.53.1684533088126; Fri, 19 May 2023 14:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684533088; cv=none; d=google.com; s=arc-20160816; b=HetyqXzu1Zh/Mt1dQ4KWhPeR/ey0zwfSBxOua+Ew+56o+0iMDUbnuHzoG5d4K3HWfo IEzrJApFHQiy6kV3B8zAgTFLOARkpxINb3iHlixbRo8klHQM4jWiv8mNbKWWQaS3EKtP lOEg9fw9QairqzwQ6F1+d/7RcvghTVwPl0qxJr8skTGauQu0Y2LAzQUS+MzRCt8qqbdH FEWomPV1JCfNVCQVvPuhEb7x3uZJX/I50DDAtnr6cyQ2R2BruOUvixcDGHQwWF8kCoQq WH837pXzsLIy/D2MagU1JMo8I/tJOrqyKz7BLKq8YUOgOsCaCLNzWkKjqMHFwIsJXPP9 ZfVg== 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 :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from; bh=L8aRjlVMJ2EBJbanMpiNVo9Oxu2hYsPIpmHzNRGR9OQ=; b=fVVrk1nwZIh3ZyY/2P01SRjGJP2stydwsVBxx+o/D7iNyLKzYPt18ye3MCFPCPjje+ Bflkklgv+/91p3lfewBKSHJFQLwX/lwnVi33Dw2C+stJCq9FN5LpNIK8DVi2F16FIejl 6L6BcQ+HRUNa6DV8YnCc6CUV8lclfPaGvtsmdTg++3f1Qso4ELD6lDP4JRxLNl9DCRgy LhldlQAsKkZ8TbMoFVEduxLVHWrwRDN2YsQlHxRcwp2+gS8TpSs3LdCLjI1ODobQ81Uy PcJlvYtPaNF9R5GgIfiJgM5Ek5emN/iZoRgyksWwZER7Z7WpzaFRAWtAh3ZOUZg1H5fh oGUg== ARC-Authentication-Results: i=1; mx.google.com; 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 k15-20020aa7998f000000b0064d40b9a96dsi232447pfh.330.2023.05.19.14.51.13; Fri, 19 May 2023 14:51:28 -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; 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 S230049AbjESVuW (ORCPT + 99 others); Fri, 19 May 2023 17:50:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbjESVts (ORCPT ); Fri, 19 May 2023 17:49:48 -0400 Received: from mail-out.m-online.net (mail-out.m-online.net [IPv6:2001:a60:0:28:0:1:25:1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A5FB19BB for ; Fri, 19 May 2023 14:49:29 -0700 (PDT) Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4QNL8F1tK7z1sG8n; Fri, 19 May 2023 23:49:01 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4QNL8D5nw0z1qqlY; Fri, 19 May 2023 23:49:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id XyLPMARxDKv3; Fri, 19 May 2023 23:48:59 +0200 (CEST) X-Auth-Info: UdoOlGJyC/tj1C8t/F+qwKRDlPRVzwm7sF3nVhFHfZv+Z8M1psgK2wdJJpzQJ6gi Received: from igel.home (aftr-62-216-205-130.dynamic.mnet-online.de [62.216.205.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Fri, 19 May 2023 23:48:59 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 79E822C1CCF; Fri, 19 May 2023 23:48:59 +0200 (CEST) From: Andreas Schwab To: Alexandre Ghiti Cc: 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 Subject: Re: [PATCH v8 1/3] riscv: Introduce CONFIG_RELOCATABLE In-Reply-To: <6fc7f0e1-0dde-9b41-0d60-6b0bd65bb630@ghiti.fr> (Alexandre Ghiti's message of "Fri, 19 May 2023 13:08:12 +0200") References: <20230215143626.453491-1-alexghiti@rivosinc.com> <20230215143626.453491-2-alexghiti@rivosinc.com> <87wn1h5nne.fsf@igel.home> <4adb27d2-325d-3ce0-23b1-ec69a973b4bf@ghiti.fr> <87ttwi91g0.fsf@igel.home> <6fc7f0e1-0dde-9b41-0d60-6b0bd65bb630@ghiti.fr> X-Yow: YOW!! Up ahead! It's a DONUT HUT!! Date: Fri, 19 May 2023 23:48:59 +0200 Message-ID: <87sfbsvvp0.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,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 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. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."