From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [IPv6:2001:470:683e::1]) by sourceware.org (Postfix) with ESMTPS id 968963858C50 for ; Wed, 17 Aug 2022 07:44:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 968963858C50 Received: from [IPv6:240e:358:118c:b800:dc73:854d:832e:3] (unknown [IPv6:240e:358:118c:b800:dc73:854d:832e:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id D189A667C4; Wed, 17 Aug 2022 03:44:08 -0400 (EDT) Message-ID: Subject: Re: [PATCH 1/1] LoongArch: Add pointer mangling support. From: Xi Ruoyao To: Joseph Myers Cc: caiyinyu , xuchenghua@loongson.cn, i.swmail@xen0n.name, libc-alpha@sourceware.org Date: Wed, 17 Aug 2022 15:43:59 +0800 In-Reply-To: References: <20220811040056.3164122-1-caiyinyu@loongson.cn> <3740676145dbfab3595458d7a730272acd6fb928.camel@xry111.site> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.45.2 MIME-Version: 1.0 X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, LIKELY_SPAM_FROM, PDS_OTHER_BAD_TLD, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Aug 2022 07:44:16 -0000 On Tue, 2022-08-16 at 15:23 +0000, Joseph Myers wrote: > > > No, we must use Binutils-2.40 for new relocation types like %pc_hi20.= =20 > > > Maybe we can add a configure check to fallback to "la.pcrel"/"la.got" > > > macros for Binutils <=3D 2.39. > >=20 > > Hmm... AFAIK our ld.so is already broken with Binutils <=3D 2.39, so > > perhaps we should just claim Binutils <=3D 2.39 are not supported. >=20 > Requiring unreleased versions is bad for users and distributors; it would= =20 > be better to backport whatever binutils patches are required to 2.39=20 > branch (assuming they are LoongArch-specific patches, rather than changes= =20 > to architecture-independent parts of binutils that are risky for other > architectures) and add configure tests to work around any that don't get= =20 > backported. I share your feeling... But the fix needed by ld.so (bc2a35c in binutils-gdb.git) is after two commits massively changing the relocation types. Backporting the relocation type changes is completely unacceptable (such an attempt will do nothing except annoying Nick Clifton :). And bc2a35c alone cannot be backported trivially. I've published a separate version of bc2a35c as the attachment of https://sourceware.org/pipermail/libc-alpha/2022-July/140949.html, but it's not a trivial backport: I had to change some code where bc2a35a does not change or the path for "old" relocation types would just overflow the heap buffer and corrupt the heap. And my backport is not reviewed or tested carefully. P. S. Currently building Glibc requires Binutils >=3D 2.40, but building the kernel modules requires Binutils <=3D 2.39. This effectively forces every LoongArch distribution to ship two toolchains :(. I hope we can end this madness soon. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University