Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp34853854rwd; Sun, 9 Jul 2023 22:04:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlE2GTE+P/BRgsLo7eexw5dt3RhrxnDd80MrnVBZQ5c16SqlP5cR+ehTOv6NhkjYy3+XRnwC X-Received: by 2002:a17:90b:1e4a:b0:263:f435:ef2d with SMTP id pi10-20020a17090b1e4a00b00263f435ef2dmr8806679pjb.10.1688965489915; Sun, 09 Jul 2023 22:04:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688965489; cv=none; d=google.com; s=arc-20160816; b=L8rK+VzRE92vIcJHEOE3VUuCrBhzsL9EYPWzZ9Q9FGHXgW2jxGFbgD3HlfYY/rv+CR QKHItnZlOm8sfDxisQqKxAoLVFmXFdqoS7GreowebdKRd0W65ykiBGoNedzewVX1Rfft tqGXq/pnOv8aimu/0e4M9D1UAXN6f7NX1osqgn4/lwtukTttPrmjuTXHZIs9K9HP5YPz ifTlsbUVZAC/rO3Tm6a7aPfTCZUvvSMsOdJLPRyH6QmmmrnCweJWrydMUaVI6G/9zL3B TvOD8d/S08+PSf8GXdYO1sincn6/bdHXRaLYOSsNLV/Lf1vNqh9JHJMoxJMF26Xar5ho b5cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=fTYRv9let+cltg1ZmntPhU0m5Fy+pBY3lBfjRR1ctWg=; fh=GuMN8enMd6fdjVr3rKRxDWIu2u42A3ql/rBtrFStIBU=; b=pYVUB+vOs3PfkKVGVYS0yTJkbSDxAZNIUD4SV9jNp8Qyy50uSz5uTXXnl2ou42JBDk l12ZUui0uTqa5UJ/OnLatiNtbRoCM4gcEBcE0VtUbPvULthILz6QfJEqCT2R+VYvY6MC Z6T/L+azQvEPNdpXmzAVIxvqv9PRzTsuvcs8A+p73seAA4LEAT01Ab/5HWJz0Cs8rqyz 06boYENP1P5kOK+Nfo2lUO8KPynY48jwDHfprtXu6NmEoD2n8foxQ5N+r/RgraMr3+Ay NPg8hYAMvMaWImiFRU4VmLUxfu9ODc9n8xwS8pTSmTUtdSIrKVuCJlAFwdjcTnczLc7z tl/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=IgmaXU1t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h23-20020a17090aa89700b002634cad1d64si3511940pjq.75.2023.07.09.22.04.38; Sun, 09 Jul 2023 22:04:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=IgmaXU1t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229983AbjGJEp0 (ORCPT + 99 others); Mon, 10 Jul 2023 00:45:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbjGJEpW (ORCPT ); Mon, 10 Jul 2023 00:45:22 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7720F118; Sun, 9 Jul 2023 21:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1688964317; bh=nIwe2M/K3NQxgFY9TidL4zat/EkEm3ppvGS805ltn0Q=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=IgmaXU1t56yfNOvUBbXMAV5UkrjaHK6Vsn4HnnThZx5mazGwlEeGxejhyB4Zheo5c DThGe01Wvw7ZpeECCJVYhXUNa3w5uCjz6DQd9anvI0LG+mc+uzBLIBeOKK7o7C70Sc HRuacz4YfI3J0RbA8pgIXpvPX0SxTwwjNLfxq1jw= Received: from [100.100.34.13] (unknown [220.248.53.61]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 0F71F600AE; Mon, 10 Jul 2023 12:45:17 +0800 (CST) Message-ID: <51181fd7-fc1f-2222-9b8a-8ce44fe85ea5@xen0n.name> Date: Mon, 10 Jul 2023 12:45:16 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] LoongArch: Fix module relocation error with binutils 2.41 Content-Language: en-US To: Huacai Chen , Arnd Bergmann , Huacai Chen Cc: loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Xuefeng Li , Guo Ren , Jiaxun Yang , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn References: <20230710042924.2518198-1-chenhuacai@loongson.cn> From: WANG Xuerui In-Reply-To: <20230710042924.2518198-1-chenhuacai@loongson.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/7/10 12:29, Huacai Chen wrote: > Binutils 2.41 enable linker relaxation by default, but kernel module "enables" / "will enable" > loader doesn't support that, so disable it. Otherwise we get such an > error when loading modules: "Unknown relocation type 102". IMO it could be better to also justify the disabling (instead of adding proper support): linker relaxation is relatively large complexity that may or may not bring a similar gain, and we don't really want to include this linker pass in the kernel. > > Signed-off-by: Huacai Chen > --- > arch/loongarch/Makefile | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile > index 09ba338a64de..7466d3b15db8 100644 > --- a/arch/loongarch/Makefile > +++ b/arch/loongarch/Makefile > @@ -68,6 +68,8 @@ LDFLAGS_vmlinux += -static -n -nostdlib > ifdef CONFIG_AS_HAS_EXPLICIT_RELOCS > cflags-y += $(call cc-option,-mexplicit-relocs) > KBUILD_CFLAGS_KERNEL += $(call cc-option,-mdirect-extern-access) > +KBUILD_AFLAGS_MODULE += $(call cc-option,-mno-relax) $(call cc-option,-Wa$(comma)-mno-relax) > +KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax) $(call cc-option,-Wa$(comma)-mno-relax) > else > cflags-y += $(call cc-option,-mno-explicit-relocs) > KBUILD_AFLAGS_KERNEL += -Wa,-mla-global-with-pcrel The code changes are good. With the commit message improved: Reviewed-by: WANG Xuerui -- WANG "xen0n" Xuerui Linux/LoongArch mailing list: https://lore.kernel.org/loongarch/