Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3192586pxv; Mon, 12 Jul 2021 11:29:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQZ9xVzctdMrNstabPo+hqjVjBqqUBLlv7wPiNUdA5ZXw5+0vwsv9USkuO9opjmzofWpjM X-Received: by 2002:aa7:cd5a:: with SMTP id v26mr162539edw.287.1626114585194; Mon, 12 Jul 2021 11:29:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626114585; cv=none; d=google.com; s=arc-20160816; b=vNYmXo0D8To2U5sSDNGrWeL3qP6mWnnU1aYBVVYudqqQoCIb4xUMLktHbaCRHU11u4 eZnn60G6n5CoD2wepo5yYpAsA/Ms1BTMCbvDdUFW8xeh9dB85wfm78+SE4dsbUk1hbMv OWeJu6tJXUUiAwX8QzSfmd6JrHgBA1SSkgy8zS2cYkVTa/Q792JoYUUnXSJZAkyj73UX Yp5x9DtzUjrnvf+U2rZKpCLtpqFUJyWJyMxZ+6FeilzCtoiMwIbdJ/WOGrUN0CAgCSjR B/rTC8OGXPx11TBhRMEal3KjUPFmF3E3/R5rl8h7m7VVQ8vSE7YCASY+VW/uiYmR4KsW L/qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Fat5dxqyvvV7IOVwdIZK3NigC1KA/qo/D5WsWtk0ipI=; b=ayr5eSqq4WHwAGiUi5kqMAUS1ABCAh/cChpV5fRP8RZCCcAqtuFHhWluMwNhqn3ARP gYnLL4PyTT+xt4nK1ZvAygBQ+5EHPzyE1Rb2I+1FHO8NCkgp+yhK7irMa2j3CusSGWTk sAoNRKDKfqnYHo8JAHdKPc1zwI/P05A0JjT7ACTC+i0tc06aN2aisCGbHq4wkZv7mmXK MnbnBLUjUli/IKHhg/5XbaL8hykE2SfW8ZONVb0qK1/zf7HrNadKqsugAYHsSxAitixu MBkRkuobCstluLlaazOlPIPlhFzZp3p1gBEdjmisp6UjxasGP3c0jGz66hqKEmHvPt2J WrAw== 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 bl4si21335915ejb.689.2021.07.12.11.29.18; Mon, 12 Jul 2021 11:29:45 -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 S234382AbhGLSat (ORCPT + 99 others); Mon, 12 Jul 2021 14:30:49 -0400 Received: from imap3.hz.codethink.co.uk ([176.9.8.87]:58846 "EHLO imap3.hz.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230477AbhGLSas (ORCPT ); Mon, 12 Jul 2021 14:30:48 -0400 X-Greylist: delayed 2346 seconds by postgrey-1.27 at vger.kernel.org; Mon, 12 Jul 2021 14:30:48 EDT Received: from cpc152649-stkp13-2-0-cust121.10-2.cable.virginm.net ([86.15.83.122] helo=rainbowdash) by imap3.hz.codethink.co.uk with esmtpsa (Exim 4.92 #3 (Debian)) id 1m3032-0000CA-0D; Mon, 12 Jul 2021 18:48:52 +0100 Received: from ben by rainbowdash with local (Exim 4.94.2) (envelope-from ) id 1m3030-009EvY-Q4; Mon, 12 Jul 2021 18:48:50 +0100 From: Ben Dooks To: linux-kernel@lists.codethink.co.uk, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Cc: Paul Walmsley , Palmer Dabbelt , Albert Ou , Ben Dooks Subject: [PATCH] riscv: add correct as-options for assembly in modules Date: Mon, 12 Jul 2021 18:48:49 +0100 Message-Id: <20210712174849.2202287-1-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 -- 2.30.2