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 D83233858C52 for ; Fri, 23 Sep 2022 11:17:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D83233858C52 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=1663931823; bh=YMIfoDoB1Hv6OzLV26IRrw9RphZiEpTvADJ8ssec0+M=; h=From:To:Cc:Subject:Date:From; b=Rlisr4sRlsG4GJLF0SOLM55/5pighvalcvksUiv0e2lV2i7DcxsbFuX01axTD0eMN ODQszoYs+yVMM7p3hpvAbgDO2gmpwukliAYtTPIv+sRN9bvTm7MTxo5PyJ+Ncn7b0o PvLUBW9X6fRZ/8BFrsC1nm8MyqVuSKGI3FYtuGfk= Received: from xry111-x57s1.. (unknown [IPv6:240e:358:11af:2800: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 3F16065EB4; Fri, 23 Sep 2022 07:16:56 -0400 (EDT) From: Xi Ruoyao To: libc-alpha@sourceware.org Cc: caiyinyu , liuzhensong , Lulu Cheng , Wang Xuerui , Chenghua Xu , Xi Ruoyao Subject: [PATCH v2 0/1] LoongArch: Add static PIE support Date: Fri, 23 Sep 2022 19:16:46 +0800 Message-Id: <20220923111647.48303-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.7 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,SPF_HELO_PASS,SPF_PASS,TXREP,T_PDS_OTHER_BAD_TLD 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: Static PIE allows us to extend the ASLR to cover static executables, this patch adds static PIE support for LoongArch. Changes from v1 to v2: check the relocation of linker output for -static-pie to see if it really works, instead of checking GCC version. Change from RFC to v1: no change, just remove "RFC" because the GCC [1] and Binutils [2][3] patches are already merged. [1]: https://gcc.gnu.org/r13-2728 [2]: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ae2e4d4 Summary of test results (with GCC trunk and Binutils trunk): 4592 PASS 22 UNSUPPORTED 12 XFAIL 6 XPASS Use "sln" as an example to show it works: $ file elf/sln elf/sln: ELF 64-bit LSB pie executable, LoongArch, version 1 (SYSV), static-pie linked, for GNU/Linux 5.19.0, with debug_info, not stripped $ touch a $ elf/sln a b $ readlink b a Xi Ruoyao (1): LoongArch: Add static PIE support sysdeps/loongarch/configure | 37 ++++++++++++++++++++++++++++++++++ sysdeps/loongarch/configure.ac | 14 +++++++++++++ sysdeps/loongarch/start.S | 14 ++++++++++--- 3 files changed, 62 insertions(+), 3 deletions(-) -- 2.37.0