Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp603236rwl; Wed, 9 Aug 2023 21:17:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGLPDoJaEi66PSMJqjrDkCn3sk4sN7rXbjTE42hWoXEdzdK2q+QNrFCcopEjDN1qHbDLhIw X-Received: by 2002:a05:6512:3452:b0:4f6:2b51:2f74 with SMTP id j18-20020a056512345200b004f62b512f74mr676159lfr.52.1691641060085; Wed, 09 Aug 2023 21:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691641060; cv=none; d=google.com; s=arc-20160816; b=zb/hAlnPfZqQnsCKAcBSQ/6thm5P+RaUwqzFV6zr04kqTw6uSUtYBly6+UAi+DZz5k SDEOaaGrG0sFMDbFH3FQ8DoXYhxJpcxms6WNZ75WSFcLuNSBVC/vXelYwZ79l3HH2HIL jyD7sHrMcT6PhG960CCn7bbtR2G9J/ndFMfKNdrMCuwp2nyYl0mBBJvfr3cqq/5e4cX4 aM0gRw/ugz4pp/pJpJJ4/3eQGsjx8dvHHKp/1Fb/j853JOzEe4mscpKCLogxZ5DkN31/ 1mGpcg6UL2Qb7BpQ0mTaZjATPCTNQPlfvIl9SWL0ARNaLJh6xbOT6PP0raF1EAsDSU8f wfUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=xApx5qfLp9QXyoYp4Ei4hkgqubPZTV3Cw/jAmt5mu5o=; fh=531y0j3GMGuSnvV3TfPO4gMltikPOuCzhLe5vz+3cwQ=; b=d3TZPrC4UVeaH6Fm6ETVbIlEm/Xv+lDJqy3gEoxIR7R8wxEQCJdKw4n6UrTALUx+4v tn85Soz1RunfMazdKkfwE9ulgcKzxjDtI6L0QroaEfz4rTtgFzvxC/T0PJH8k1geNaZT Pmamm4yurMDBBl9oMveflCBfbhB6VocVaiLBqWXs8shvdl3dTH1egqu6Lss/wJNc+Qzd 95Zd80Hgzlv1fcqFHsp9mxxdHePgBiOYECdbL1XmFpcHNNQh0b85XmZAvfD3Be1XAw5W hK5ob/b9EdtzLcr/5EbuGWqoJNSyo3qbeXoqRbI8NM82s67eIQN6RL4ytSaYu7Z+yWCB gJOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b=eSXFDeiq; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jw26-20020a17090776ba00b0099bd39dcec3si688175ejc.95.2023.08.09.21.17.15; Wed, 09 Aug 2023 21:17:40 -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=@xry111.site header.s=default header.b=eSXFDeiq; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232065AbjHJDVt (ORCPT + 99 others); Wed, 9 Aug 2023 23:21:49 -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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS 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 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