Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3B7FC433EF for ; Mon, 10 Jan 2022 16:11:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237076AbiAJQL4 (ORCPT ); Mon, 10 Jan 2022 11:11:56 -0500 Received: from imap2.colo.codethink.co.uk ([78.40.148.184]:45720 "EHLO imap2.colo.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236654AbiAJQLy (ORCPT ); Mon, 10 Jan 2022 11:11:54 -0500 X-Greylist: delayed 1240 seconds by postgrey-1.27 at vger.kernel.org; Mon, 10 Jan 2022 11:11:54 EST Received: from cpc152649-stkp13-2-0-cust121.10-2.cable.virginm.net ([86.15.83.122] helo=[192.168.0.21]) by imap2.colo.codethink.co.uk with esmtpsa (Exim 4.92 #3 (Debian)) id 1n6wwu-00016E-NW; Mon, 10 Jan 2022 15:51:08 +0000 Message-ID: <7ff4062a-4ed0-2cf8-cbe9-c446f79fac39@codethink.co.uk> Date: Mon, 10 Jan 2022 15:51:07 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH] riscv: add correct as-options for assembly in modules Content-Language: en-GB To: linux-kernel@lists.codethink.co.uk, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Cc: Palmer Dabbelt , Albert Ou , Bin Meng References: <20211208192607.660787-1-ben.dooks@codethink.co.uk> From: Ben Dooks Organization: Codethink Limited. In-Reply-To: <20211208192607.660787-1-ben.dooks@codethink.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/12/2021 19:26, Ben Dooks wrote: > When trying to load modules built for riscv which include assembly > the kernel loader errors with "unexpected relocation type 'R_RISCV_ALIGN'" > due to R_RISCV_ALIGN relocations being generated by the assembler. > > In commit 7a8e7da42250138 ("RISC-V: Fixes to module loading") the > CFLAGS have -mno-relax added. This however does not get applied to > KBUILD_AFLAGS_MODULE so when a module builds a .S file, the -mno-relax > is not passed and the above error is seen. Fix it by adding the flags > '-Wa,-mno-relax' to KBUILD_AFLAGS_MODULE. > > This may have been fixed in gcc, in: > https://github.com/gcc-mirror/gcc/commit/3b0a7d624e64eeb81e4d5e8c62c46d86ef521857 Can I just check this can be included in the next release? -- Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html