Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1402637pxv; Fri, 16 Jul 2021 08:35:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9T5HI4Aioo63NPPLw77Xr8yJHC5dxYU1S69pz8QyTlPsJ+S2pXpUZGmWj3B2QDRt0Kx6P X-Received: by 2002:a05:6e02:2194:: with SMTP id j20mr7158374ila.108.1626449758438; Fri, 16 Jul 2021 08:35:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626449758; cv=none; d=google.com; s=arc-20160816; b=oiZS/mm1bMZ9XxzVTd++xEjjfaREt9tXTywvjZu8M96P5EYCjlM7H6Gx0urWzlqcsx +a9Mb/oPDCQlD/zLF9aj4auH9e9xZDh14qZQG4bS9vnNpZAqBk9BW3tRpAkvI1W+7lyZ LqaZ4AytZyTk5AJ5b5/uutpj51yMCUcmFKTDbv1YW7zJcc8ADlAFVlbTRZu5dojBDisW wY8+qEEksLUdn0Cta6zcU1IJspjFj0tzZ4yv/kkioqucvsQ+l/F/OLf44lVGtUccPsLZ +OsN+DnSGt4p2nDQ9lYauq79VRR/UvZMt/IijtqYvRZRsnXT0tGGDMVVeSoZ8Grwqk28 5JNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject; bh=fo2x0U+S4hW3ER+dKURSeDSb+0WRHxjcITg1RoA++os=; b=cm12/KmgCmlRGDGJBBFvELVS6QiBck5JPPAW6GtkoBKLEoUmj6ve6h2Za8iGu9v8aq 9Z25YaMyOqYlkoC46kQYT7ilEN0kKu3GKfXKJbkj0+jpRbze0vSd8HGq5UkTsgdPaEyQ lDuN4e4URV2WhBq0vkpybvlm5DZlo4E1pAYP3WCfZCOYY6UiFVcYlzQ7hAbgKR7LBZai zzMIwrzJWWQ3wOMa0SxY2Gc7bBSov2Ems5T/nw/+axkFHFYaLWBRF3INwbv1epxqMClP nPUkocR4kQsX+p5MNfL2WvnfY4IH2Es5AOHb/chKnwKz9flwW3bG8iwSHnbtWlyA4iLm 2ODA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t7si10529522jam.62.2021.07.16.08.35.46; Fri, 16 Jul 2021 08:35:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codethink.co.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240876AbhGPPgJ (ORCPT + 99 others); Fri, 16 Jul 2021 11:36:09 -0400 Received: from imap2.colo.codethink.co.uk ([78.40.148.184]:46242 "EHLO imap2.colo.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240972AbhGPPgI (ORCPT ); Fri, 16 Jul 2021 11:36:08 -0400 Received: from [167.98.27.226] (helo=[10.35.5.170]) by imap2.colo.codethink.co.uk with esmtpsa (Exim 4.92 #3 (Debian)) id 1m4Pps-0000Ha-Ke; Fri, 16 Jul 2021 16:33:08 +0100 Subject: Re: [PATCH] riscv: add correct as-options for assembly in modules To: Bin Meng Cc: linux-kernel@lists.codethink.co.uk, linux-kernel , linux-riscv , Paul Walmsley , Palmer Dabbelt , Albert Ou References: <20210712174849.2202287-1-ben.dooks@codethink.co.uk> From: Ben Dooks Organization: Codethink Limited. Message-ID: <36a5d9d8-67be-e128-2798-5bf1989ce06d@codethink.co.uk> Date: Fri, 16 Jul 2021 16:33:07 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: 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 16/07/2021 11:44, Bin Meng wrote: > On Tue, Jul 13, 2021 at 2:28 AM Ben Dooks wrote: >> >> When trying to load modules built for riscv which include assembly > > nits: RISC-V > >> 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 fix for gcc adds -mno-relax to the command line when building >> C files. However this was never applied to assembly flags, and gcc >> does no pass -mno-relax to gas when presented with a .S file. > > does not pass I'll see if I can make this simpler. Should this get done for a v2? > FYI > > The GCC bug was fixed recently via: > https://github.com/gcc-mirror/gcc/commit/3b0a7d624e64eeb81e4d5e8c62c46d86ef521857 thanks, I think it still useful to fix this in the kernel. >> >> The fix (other than making gcc always pass -mno-relax to gas) is >> to add -Wa,-mno-relax to gcc to make sure the as is invoked with >> the right options. >> >> Signed-off-by: Ben Dooks >> --- >> arch/riscv/Makefile | 1 + >> 1 file changed, 1 insertion(+) >> > > Otherwise, > Reviewed-by: Bin Meng > -- Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html