From: liuzhensong <liuzhensong@loongson.cn>
To: Xi Ruoyao <xry111@xry111.site>, binutils@sourceware.org
Cc: Lulu Cheng <chenglulu@loongson.cn>, Wang Xuerui <i@xen0n.name>,
Chenghua Xu <xuchenghua@loongson.cn>
Subject: Re: [PATCH v2 0/2] Fix two bugs breaking IFUNC in static PIE
Date: Tue, 20 Sep 2022 17:29:03 +0800 [thread overview]
Message-ID: <d03768ff-456c-752c-98a3-f62cf01505a2@loongson.cn> (raw)
In-Reply-To: <20220920060930.33357-1-xry111@xry111.site>
在 2022/9/20 下午2:09, Xi Ruoyao 写道:
> To generate a static PIE, the compiler should pass "-static -pie
> --no-dynamic-linker -z text" options to the linker [1]. But, LoongArch
> BFD linker currently produces wrong result (missing R_LARCH_IRELATIVE
> relocs) with IFUNC and those options, causing test failures in Glibc if
> static PIE is enabled. Fix them now.
>
> For the detailed analysis of the bugs see the commit messages.
>
> Changes v1 -> v2:
>
> - Stop writing into GOT for local ifunc.
> - Add a test case for R_LARCH_IRELATIVE insertion.
>
> [1]: https://gcc.gnu.org/r13-2728
>
> Xi Ruoyao (2):
> LoongArch: Don't write into GOT for local ifunc
> LoongArch: Fix R_LARCH_IRELATIVE insertion after elf_link_sort_relocs
>
> bfd/elfnn-loongarch.c | 46 +++++++++++--------
> .../ld-loongarch-elf/ld-loongarch-elf.exp | 1 +
> .../ld-loongarch-elf/local-ifunc-reloc.d | 12 +++++
> .../ld-loongarch-elf/local-ifunc-reloc.s | 28 +++++++++++
> 4 files changed, 68 insertions(+), 19 deletions(-)
> create mode 100644 ld/testsuite/ld-loongarch-elf/local-ifunc-reloc.d
> create mode 100644 ld/testsuite/ld-loongarch-elf/local-ifunc-reloc.s
>
Done.
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=6224a6c2ead26a04f0b2b8ccf4ff5b817afbb425
https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ae2e4d4035f511543d12f74b3b7fdb1ba0daab16
prev parent reply other threads:[~2022-09-20 9:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-20 6:09 Xi Ruoyao
2022-09-20 6:09 ` [PATCH v2 1/2] LoongArch: Don't write into GOT for local ifunc Xi Ruoyao
2022-09-20 6:09 ` [PATCH v2 2/2] LoongArch: Fix R_LARCH_IRELATIVE insertion after elf_link_sort_relocs Xi Ruoyao
2022-09-20 9:29 ` liuzhensong [this message]
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=d03768ff-456c-752c-98a3-f62cf01505a2@loongson.cn \
--to=liuzhensong@loongson.cn \
--cc=binutils@sourceware.org \
--cc=chenglulu@loongson.cn \
--cc=i@xen0n.name \
--cc=xry111@xry111.site \
--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).