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 6DC0F385F01B for ; Mon, 18 Jul 2022 11:45:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6DC0F385F01B 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 516DE6690D; Mon, 18 Jul 2022 07:45:20 -0400 (EDT) Message-ID: <042da55744d6a20e03546c9e6546e23b94d25fa8.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: Mon, 18 Jul 2022 19:45:17 +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=-7.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FROM_SUSPICIOUS_NTLD, GIT_PATCH_0, LIKELY_SPAM_FROM, PDS_OTHER_BAD_TLD, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham 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 11:45:25 -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. >=20 > =C2=A0 bfd/ > =C2=A0=C2=A0=C2=A0 elfnn-loongarch.c > --- > =C2=A0bfd/elfnn-loongarch.c | 322 +++++++++++++++++++++++++++++++++++++++= +-- > =C2=A01 file changed, 310 insertions(+), 12 deletions(-) >=20 > diff --git a/bfd/elfnn-loongarch.c b/bfd/elfnn-loongarch.c > index 4eeaeb44eff..5bb7596e5d0 100644 > --- a/bfd/elfnn-loongarch.c > +++ b/bfd/elfnn-loongarch.c > @@ -1207,6 +1207,259 @@ allocate_dynrelocs (struct elf_link_hash_entry *h= , void *inf) > =C2=A0=C2=A0 return true; > =C2=A0} > =C2=A0 > +/* Based function _bfd_elf_allocate_ifunc_dyn_relocs. "A modified version of _bfd_elf_allocate_ifunc_dyn_relocs." > +=C2=A0=C2=A0 For local def and ref ifunc, > +=C2=A0=C2=A0 dynamic relocations are stored in > +=C2=A0=C2=A0 1.=C2=A0 rel[a].irelifunc section in PIC object. > +=C2=A0=C2=A0 2.=C2=A0 rel[a].srelgot section in dynamic executable. > +=C2=A0=C2=A0 3.=C2=A0 rel[a].irelplt section in static executable. For entire patch, I think it's better to remove those "[]" around "a": for LoongArch we always use .rela.*, not .rel.* . > +=C2=A0=C2=A0 Change ifunc dynamic info from srelplt to srelgot. > +=C2=A0=C2=A0 In loader, remove R_LARCH_IRELACTIVE from rela lazy in ld.s= o.=C2=A0 */ "Unlike _bfd_elf_allocate_ifunc_dyn_relocs, .rela.srelgot is used instead of .rela.srelplt. Glibc ELF loader will not support R_LARCH_IRELATIVE relocation in .rela.plt." My English is not good either, but the origin comment is obviously some Chinglish. Xuerui: can you help to reword the comments in this series? --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University