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 6BC7F3858406 for ; Tue, 13 Sep 2022 15:44:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6BC7F3858406 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1663083876; bh=Y9+7mYE19BAiAUUrQh9O7GA8sHY0Oe3E13yeuM2emVg=; h=From:To:Cc:Subject:Date:From; b=A5X8PSIynkH3zEwvWfPDiVSxsIhlLLtSHPgcg8FzJnxNj573gAap0Y3+Gxgb0onhJ Z2NMwgcNb2ZseAFA8cHfdEc0k5S61Wyyh8YmrmWkLOemDgkG04GR3cGzblh0Y5j553 aLBv1StfG1uKFPhFStBq1oUV7iDIPEC72z9e9Sj4= Received: from xry111-x57s1.. (unknown [IPv6:240e:358:1123:8b00:dc73:854d:832e:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 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 00B0465C28; Tue, 13 Sep 2022 11:44:32 -0400 (EDT) From: Xi Ruoyao To: binutils@sourceware.org Cc: liuzhensong , Lulu Cheng , Wang Xuerui , Chenghua Xu , Xi Ruoyao Subject: [PATCH 0/2] LoongArch: Fix two bugs breaking IFUNC in static PIE Date: Tue, 13 Sep 2022 23:44:12 +0800 Message-Id: <20220913154414.554861-1-xry111@xry111.site> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FROM_SUSPICIOUS_NTLD,FROM_SUSPICIOUS_NTLD_FP,KAM_SHORT,LIKELY_SPAM_FROM,PDS_OTHER_BAD_TLD,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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