Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1175637pxv; Fri, 16 Jul 2021 03:27:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmdTbjXj/8wIIWUcayIxc/Te3R2R4N62ML+LBDIW0FCfdZsixynxyWPQaeNj9cjtpXmWoo X-Received: by 2002:a02:c491:: with SMTP id t17mr3717288jam.56.1626431220421; Fri, 16 Jul 2021 03:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626431220; cv=none; d=google.com; s=arc-20160816; b=nxF4ZnLQ9XGq0xmM7OwGsZ1nHJd5yewBySSpzL21vTAgPmDAtD11+HxEJUnrNm/GzK 3A5ZoQXp6/vFdRcchl9nm6t7Bui9eFAvsAXfWWy+fhJCxwGrljXvE8E82Ryg5/+fLM7E U1XM98YMjkNZ7KDGLGqm27BeC8WvmTovnzQL5BvjnqKsQniCdnLDnCjnlXcy8/gtHcrR +W7mYWK4QDXDT2NSSzeMJ59c0N5TgvK7Bm6vucqf9uy/Z1ceGWor4a48v/trF1l5EJbB jvxvQvaVyf5aIfei0GsmYfaUkytfMkUq9iC6P40Eah+vNWjPmoagdzPEGZjXuI6W7D0v 9J4g== 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=7Posmx7v66gelK3WLX4bMzZ1n+sq2qzeq73v1eZAhYI=; b=Hjv61ANR6ny+fi9NYi/br4fZXhRISeG84+xmwhZlmu6tT6wZUQU4Fi0vFrQ5fKvCVF 1+/Xy9qQ+bLRGaCXd2pkbr2yUEP8R2X0ypalE36pcIns78Pu7EAr16bSogo6cqu8t6Zx yeXeQC3KxPb78+l52Byc2V0cCzvKJlRug/xlhNGtmTTye/uUHNW7d1ebZb/j6xEBQ6BX q1gsSVTHfb0JyKwROMt6h53FVkq0qCb4WdZha7/0ioLs22eT4mn1TcgqtxIfiDoF16U1 vWA11WcIfq8TLf/yzAPNJWzT7DPSGlsjMqgUEbEU5mp4s0HPylRmLQygBUg1fGBPJCRp 997w== 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 t17si10364525jal.112.2021.07.16.03.26.48; Fri, 16 Jul 2021 03:27:00 -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 S238392AbhGPK11 (ORCPT + 99 others); Fri, 16 Jul 2021 06:27:27 -0400 Received: from imap2.colo.codethink.co.uk ([78.40.148.184]:36214 "EHLO imap2.colo.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239175AbhGPK0r (ORCPT ); Fri, 16 Jul 2021 06:26:47 -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 1m4L0W-0006x0-GA; Fri, 16 Jul 2021 11:23:48 +0100 Subject: Re: [PATCH] riscv: add correct as-options for assembly in modules To: linux-kernel@lists.codethink.co.uk, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou References: <20210712174849.2202287-1-ben.dooks@codethink.co.uk> From: Ben Dooks Organization: Codethink Limited. Message-ID: Date: Fri, 16 Jul 2021 11:23:47 +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: <20210712174849.2202287-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 12/07/2021 18:48, 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 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. > > 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 Just wanted to find out if anyone has had time to review this. If this is ok, should we also send to -stable ? > --- > arch/riscv/Makefile | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/riscv/Makefile b/arch/riscv/Makefile > index 1f5c03082976..fca40511a8c6 100644 > --- a/arch/riscv/Makefile > +++ b/arch/riscv/Makefile > @@ -60,6 +60,7 @@ ifeq ($(CONFIG_PERF_EVENTS),y) > endif > > KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax) > +KBUILD_AFLAGS_MODULE += $(call as-option,-Wa$(comma)-mno-relax) > > # GCC versions that support the "-mstrict-align" option default to allowing > # unaligned accesses. While unaligned accesses are explicitly allowed in the > -- Ben Dooks http://www.codethink.co.uk/ Senior Engineer Codethink - Providing Genius https://www.codethink.co.uk/privacy.html