From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from xry111.site (xry111.site [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id A3D833858D28 for ; Mon, 18 Jul 2022 16:27:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A3D833858D28 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) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 2D80D669F4; Mon, 18 Jul 2022 12:27:33 -0400 (EDT) Message-ID: <3e53c1fcc7b4599340f341988e07b86d7a911ab8.camel@xry111.site> Subject: Re: [PATCH 4/5 v1] LoongArch: Move ifunc info to rela.dyn from rela.plt. From: Xi Ruoyao To: liuzhensong , binutils@sourceware.org Cc: xuchenghua@loongson.cn, mengqinggang@loongson.cn, WANG Xuerui Date: Tue, 19 Jul 2022 00:27:32 +0800 In-Reply-To: <20220718084316.390672-4-liuzhensong@loongson.cn> References: <20220718084316.390672-1-liuzhensong@loongson.cn> <20220718084316.390672-4-liuzhensong@loongson.cn> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 MIME-Version: 1.0 X-Spam-Status: No, score=-1.0 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 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jul 2022 16:27:37 -0000 On Mon, 2022-07-18 at 16:43 +0800, liuzhensong wrote: > =C2=A0 Delete R_LARCH_IRELATIVE from dynamic loader (glibc ld.so) when > =C2=A0 loading lazy function (rela.plt section). >=20 > =C2=A0 In dynamic programes, move ifunc dynamic relocate info to section > =C2=A0 srelgot from srelplt. The main point of this change is allowing us to enable ifunc support for Glibc, right? But have you tested building Glibc using a ld with this series applied? It does not work well for me: FAIL: elf/ifuncmain1 FAIL: elf/ifuncmain1pic FAIL: elf/ifuncmain1pie FAIL: elf/ifuncmain1staticpic FAIL: elf/ifuncmain1staticpie FAIL: elf/ifuncmain1vis FAIL: elf/ifuncmain1vispic FAIL: elf/ifuncmain1vispie FAIL: elf/ifuncmain3 FAIL: elf/ifuncmain4 FAIL: elf/ifuncmain5staticpic FAIL: elf/ifuncmain7 FAIL: elf/ifuncmain7pic FAIL: elf/ifuncmain7pie Note that Binutils test suite is far from complete. For example, the ifunc handling for LoongArch target in master branch (with or w/o this patch) can pass all ld tests, but it just blows up with a simple test case: $ cat c.s .global ifunc .type ifunc, @gnu_indirect_function .set ifunc, resolver resolver: la.local $a0, impl jr $ra impl: li.w $a0, 42 jr $ra .data .global x .type x, @object x: .dword ifunc $ cc c.s -shared collect2: fatal error: ld terminated with signal 11 [Segmentation fault], c= ore dumped compilation terminated. So I think you'll at least need to build kernel/glibc/gcc using a ld with your patches to make sure it works correctly. --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University