From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1BF2C4338F for ; Tue, 10 Aug 2021 09:25:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9CDB860F56 for ; Tue, 10 Aug 2021 09:25:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238957AbhHJJZf (ORCPT ); Tue, 10 Aug 2021 05:25:35 -0400 Received: from imap3.hz.codethink.co.uk ([176.9.8.87]:53438 "EHLO imap3.hz.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236758AbhHJJZc (ORCPT ); Tue, 10 Aug 2021 05:25:32 -0400 X-Greylist: delayed 2148 seconds by postgrey-1.27 at vger.kernel.org; Tue, 10 Aug 2021 05:25:32 EDT Received: from cpc152649-stkp13-2-0-cust121.10-2.cable.virginm.net ([86.15.83.122] helo=[192.168.0.18]) by imap3.hz.codethink.co.uk with esmtpsa (Exim 4.92 #3 (Debian)) id 1mDNRj-0003Og-AP; Tue, 10 Aug 2021 09:49:15 +0100 Subject: Re: [PATCH] [PATCH v2] riscv: add as-options for modules with assembly compontents To: linux-kernel@lists.codethink.co.uk, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, Bin Meng References: <20210720144458.367954-1-ben.dooks@codethink.co.uk> From: Ben Dooks Organization: Codethink Limited. Message-ID: <8b110ad1-b5de-40ba-4131-faee1f9bde26@codethink.co.uk> Date: Tue, 10 Aug 2021 09:49:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210720144458.367954-1-ben.dooks@codethink.co.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/07/2021 15:44, Ben Dooks wrote: > When trying to load modules built for RISC-V which include assembly files > the kernel loader errors with "unexpected relocation type 'R_RISCV_ALIGN'" > due to R_RISCV_ALIGN relocations being generated by the assembler. > > The R_RISCV_ALIGN relocations can be removed at the expense of code space > by adding -mno-relax to gcc and as. In commit 7a8e7da42250138 > ("RISC-V: Fixes to module loading") -mno-relax is added to the build > variable KBUILD_CFLAGS_MODULE. See [1] for more info. > > The issue is that when kbuild builds a .S file, it invokes gcc with > the -mno-relax flag, but this is not being passed through to the > assembler. Adding -Wa,-mno-relax to KBUILD_AFLAGS_MODULE ensures that > the assembler is invoked correctly. This may have now been fixed in > gcc[2] and this addition should not stop newer gcc and as from working. > > [1] https://github.com/riscv/riscv-elf-psabi-doc/issues/183 > [2] https://github.com/gcc-mirror/gcc/commit/3b0a7d624e64eeb81e4d5e8c62c46d86ef521857 Just wanted to check v2 is fine for merging, and if so when is that likely to be? -- Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 345E2C4338F for ; Tue, 10 Aug 2021 08:50:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A3BB460F25 for ; Tue, 10 Aug 2021 08:50:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A3BB460F25 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=codethink.co.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pqvOSPfDB6P7ufpvUOTt7NOZSfEt51YovsA5VttkG+A=; b=IxdCjU27Ic9ss/b9QB1q6LcWNG Ha6CG234Shp7D5vY/8vD2dBpM47fEhTyaRt6in9XocGp7rbpchC/Yn/LJmNGF4i3q9VOpKKVkOdqS pQDPfFMuPDgFBK77LZON4x9/YVqwhLHVHcW4xwPH8hvLYCa4aLPuif+fpHdQLcJwukC5kllVzQ3H1 73SO/zZkKOMxONLK+YN5jF5wLX8OBSEg83WRcB3UKe9NELhlNDGQritD9r7lqrzBP6J4JbBxEZDXA jw3GYnNkT8wwRf9Rd5p0ZP4f6YlOfziRShUYQeX9vR+RczVmPJNeIFE/sU0U+IZzfwVOROYcv3iGR Wsjkm6kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDNS1-0038zf-VF; Tue, 10 Aug 2021 08:49:34 +0000 Received: from imap3.hz.codethink.co.uk ([176.9.8.87]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mDNRv-0038uQ-8o for linux-riscv@lists.infradead.org; Tue, 10 Aug 2021 08:49:31 +0000 Received: from cpc152649-stkp13-2-0-cust121.10-2.cable.virginm.net ([86.15.83.122] helo=[192.168.0.18]) by imap3.hz.codethink.co.uk with esmtpsa (Exim 4.92 #3 (Debian)) id 1mDNRj-0003Og-AP; Tue, 10 Aug 2021 09:49:15 +0100 Subject: Re: [PATCH] [PATCH v2] riscv: add as-options for modules with assembly compontents To: linux-kernel@lists.codethink.co.uk, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Cc: paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, Bin Meng References: <20210720144458.367954-1-ben.dooks@codethink.co.uk> From: Ben Dooks Organization: Codethink Limited. Message-ID: <8b110ad1-b5de-40ba-4131-faee1f9bde26@codethink.co.uk> Date: Tue, 10 Aug 2021 09:49:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210720144458.367954-1-ben.dooks@codethink.co.uk> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210810_014927_380845_3DE2284D X-CRM114-Status: GOOD ( 16.78 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On 20/07/2021 15:44, Ben Dooks wrote: > When trying to load modules built for RISC-V which include assembly files > the kernel loader errors with "unexpected relocation type 'R_RISCV_ALIGN'" > due to R_RISCV_ALIGN relocations being generated by the assembler. > > The R_RISCV_ALIGN relocations can be removed at the expense of code space > by adding -mno-relax to gcc and as. In commit 7a8e7da42250138 > ("RISC-V: Fixes to module loading") -mno-relax is added to the build > variable KBUILD_CFLAGS_MODULE. See [1] for more info. > > The issue is that when kbuild builds a .S file, it invokes gcc with > the -mno-relax flag, but this is not being passed through to the > assembler. Adding -Wa,-mno-relax to KBUILD_AFLAGS_MODULE ensures that > the assembler is invoked correctly. This may have now been fixed in > gcc[2] and this addition should not stop newer gcc and as from working. > > [1] https://github.com/riscv/riscv-elf-psabi-doc/issues/183 > [2] https://github.com/gcc-mirror/gcc/commit/3b0a7d624e64eeb81e4d5e8c62c46d86ef521857 Just wanted to check v2 is fine for merging, and if so when is that likely to be? -- Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv