public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/2] LoongArch: Fix two bugs breaking IFUNC in static PIE
@ 2022-09-13 15:44 Xi Ruoyao
  2022-09-13 15:44 ` [PATCH 1/2] LoongArch: Avoid heap-buffer-overflow in loongarch_elf_relocate_section Xi Ruoyao
  2022-09-13 15:44 ` [PATCH 2/2] LoongArch: Fix R_LARCH_IRELATIVE insertion after elf_link_sort_relocs Xi Ruoyao
  0 siblings, 2 replies; 13+ messages in thread
From: Xi Ruoyao @ 2022-09-13 15:44 UTC (permalink / raw)
  To: binutils; +Cc: liuzhensong, Lulu Cheng, Wang Xuerui, Chenghua Xu, 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.

[1]: https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601541.html

Xi Ruoyao (2):
  LoongArch: Avoid heap-buffer-overflow in
    loongarch_elf_relocate_section
  LoongArch: Fix R_LARCH_IRELATIVE insertion after elf_link_sort_relocs

 bfd/elfnn-loongarch.c | 59 +++++++++++++++++++++++--------------------
 1 file changed, 32 insertions(+), 27 deletions(-)

-- 
2.37.0


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-09-18  9:58 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13 15:44 [PATCH 0/2] LoongArch: Fix two bugs breaking IFUNC in static PIE Xi Ruoyao
2022-09-13 15:44 ` [PATCH 1/2] LoongArch: Avoid heap-buffer-overflow in loongarch_elf_relocate_section Xi Ruoyao
2022-09-14  8:57   ` liuzhensong
2022-09-14 10:15     ` Xi Ruoyao
2022-09-14 11:15       ` Xi Ruoyao
2022-09-15  1:47         ` liuzhensong
2022-09-15  2:56           ` Xi Ruoyao
2022-09-15  3:54             ` liuzhensong
2022-09-15  6:13               ` Xi Ruoyao
2022-09-13 15:44 ` [PATCH 2/2] LoongArch: Fix R_LARCH_IRELATIVE insertion after elf_link_sort_relocs Xi Ruoyao
2022-09-15 13:03   ` liuzhensong
2022-09-16 20:11     ` Xi Ruoyao
2022-09-18  9:58       ` Xi Ruoyao

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).