From: Xi Ruoyao <xry111@xry111.site>
To: liuzhensong <liuzhensong@loongson.cn>, binutils@sourceware.org
Cc: xuchenghua@loongson.cn, mengqinggang@loongson.cn,
WANG Xuerui <i.swmail@xen0n.name>
Subject: Re: [PATCH 4/5 v1] LoongArch: Move ifunc info to rela.dyn from rela.plt.
Date: Mon, 18 Jul 2022 19:45:17 +0800 [thread overview]
Message-ID: <042da55744d6a20e03546c9e6546e23b94d25fa8.camel@xry111.site> (raw)
In-Reply-To: <20220718084316.390672-4-liuzhensong@loongson.cn>
On Mon, 2022-07-18 at 16:43 +0800, liuzhensong wrote:
> Delete R_LARCH_IRELATIVE from dynamic loader (glibc ld.so) when
> loading lazy function (rela.plt section).
>
> In dynamic programes, move ifunc dynamic relocate info to section
> srelgot from srelplt.
>
> bfd/
> elfnn-loongarch.c
> ---
> bfd/elfnn-loongarch.c | 322 ++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 310 insertions(+), 12 deletions(-)
>
> 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)
> return true;
> }
>
> +/* Based function _bfd_elf_allocate_ifunc_dyn_relocs.
"A modified version of _bfd_elf_allocate_ifunc_dyn_relocs."
> + For local def and ref ifunc,
> + dynamic relocations are stored in
> + 1. rel[a].irelifunc section in PIC object.
> + 2. rel[a].srelgot section in dynamic executable.
> + 3. 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.* .
> + Change ifunc dynamic info from srelplt to srelgot.
> + In loader, remove R_LARCH_IRELACTIVE from rela lazy in ld.so. */
"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?
--
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University
next prev parent reply other threads:[~2022-07-18 11:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-18 8:43 [PATCH 1/5 v1] LoongArch: bfd: Add new reloc types liuzhensong
2022-07-18 8:43 ` [PATCH 2/5 v1] LoongArch:opcodes: " liuzhensong
2022-07-18 8:43 ` [PATCH 3/5 v1] LoongArch: gas: " liuzhensong
2022-07-18 8:43 ` [PATCH 4/5 v1] LoongArch: Move ifunc info to rela.dyn from rela.plt liuzhensong
2022-07-18 11:45 ` Xi Ruoyao [this message]
2022-07-18 16:27 ` Xi Ruoyao
2022-07-19 7:26 ` liuzhensong
2022-07-18 8:43 ` [PATCH 5/5 v1] LoongArch: Delete R_LARCH_NONE from dynamic info liuzhensong
2022-07-18 10:06 ` [PATCH 1/5 v1] LoongArch: bfd: Add new reloc types WANG Xuerui
2022-07-18 11:33 ` Xi Ruoyao
2022-07-18 12:11 ` WANG Xuerui
2022-07-18 12:18 ` WANG Xuerui
2022-07-19 3:57 ` Fangrui Song
2022-07-20 7:47 ` liuzhensong
2022-07-20 2:07 ` liuzhensong
2022-07-20 4:03 ` WANG Xuerui
2022-07-20 5:19 ` Xi Ruoyao
2022-07-20 12:54 ` liuzhensong
2022-07-19 7:32 ` liuzhensong
2022-07-20 2:42 ` liuzhensong
2022-07-19 4:29 ` Xi Ruoyao
2022-07-19 5:40 ` Xi Ruoyao
2022-07-19 6:31 ` 刘振松
2022-07-19 6:34 ` Xi Ruoyao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=042da55744d6a20e03546c9e6546e23b94d25fa8.camel@xry111.site \
--to=xry111@xry111.site \
--cc=binutils@sourceware.org \
--cc=i.swmail@xen0n.name \
--cc=liuzhensong@loongson.cn \
--cc=mengqinggang@loongson.cn \
--cc=xuchenghua@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).