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