From mboxrd@z Thu Jan 1 00:00:00 1970 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 97666C001E0 for ; Thu, 10 Aug 2023 03:21:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232111AbjHJDVu (ORCPT ); Wed, 9 Aug 2023 23:21:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229582AbjHJDVs (ORCPT ); Wed, 9 Aug 2023 23:21:48 -0400 Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9208D10EC for ; Wed, 9 Aug 2023 20:21:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1691637705; bh=xApx5qfLp9QXyoYp4Ei4hkgqubPZTV3Cw/jAmt5mu5o=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=eSXFDeiqvtgDU6o/yFos+i3zDORTaRCk+LC8wdteSTk25Au2n95CeSZDYIRbeZEpQ 8KDRi542FgT2lyXInFnpHAz/5pG2/bIwHODHtkv4ydiwk8Lj5gVCItTLtw2Srif/eT 6GulHswOoCAPOLxbj41EX7FEZ2P0pghZrsmVojz8= Received: from localhost.localdomain (xry111.site [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384)) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 5AC0B659AD; Wed, 9 Aug 2023 23:21:42 -0400 (EDT) Message-ID: <292e6aa6b9399c8dd53562f51237090bcd6d19c5.camel@xry111.site> Subject: Re: [PATCH V2] LoongArch: Fix module relocation error with binutils 2.41 From: Xi Ruoyao To: Huacai Chen , Arnd Bergmann , Huacai Chen Cc: loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Xuefeng Li , Guo Ren , Xuerui Wang , Jiaxun Yang , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, WANG Xuerui , stable@vger.kernel.org Date: Thu, 10 Aug 2023 11:21:40 +0800 In-Reply-To: References: <20230710050024.2519893-1-chenhuacai@loongson.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2023-08-10 at 11:20 +0800, Xi Ruoyao wrote: > Can we backport this patch into stable?=C2=A0 It fixes a build error with > binutils >=3D 2.41. Correction: not a build error, but all modules won't load if built with binutils >=3D 2.41 without the patch. > On Mon, 2023-07-10 at 13:00 +0800, Huacai Chen wrote: > > Binutils 2.41 enables linker relaxation by default, but the kernel > > module loader doesn't support that, so just disable it. Otherwise we > > get such an error when loading modules: > >=20 > > "Unknown relocation type 102" > >=20 > > As an alternative, we could add linker relaxation support in the kernel > > module loader. But it is relatively large complexity that may or may no= t > > bring a similar gain, and we don't really want to include this linker > > pass in the kernel. > >=20 > > Reviewed-by: WANG Xuerui > > Signed-off-by: Huacai Chen > > --- > > =C2=A0arch/loongarch/Makefile | 2 ++ > > =C2=A01 file changed, 2 insertions(+) > >=20 > > 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=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0+=3D -static -n -nostdlib > > =C2=A0ifdef CONFIG_AS_HAS_EXPLICIT_RELOCS > > =C2=A0cflags-y=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0+=3D $(call cc-option,-mexplicit-relocs) > > =C2=A0KBUILD_CFLAGS_KERNEL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0+=3D $(call cc-option,-mdirect-extern-access) > > +KBUILD_AFLAGS_MODULE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0+=3D $(call cc-option,-mno-relax) $(call cc-option,-Wa$(c= omma)-mno-relax) > > +KBUILD_CFLAGS_MODULE=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0+=3D $(call cc-option,-mno-relax) $(call cc-option,-Wa$(c= omma)-mno-relax) > > =C2=A0else > > =C2=A0cflags-y=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0+=3D $(call cc-option,-mno-explicit-relocs) > > =C2=A0KBUILD_AFLAGS_KERNEL=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0+=3D -Wa,-mla-global-with-pcrel >=20 --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University