public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] LoongArch: Add static PIE support
@ 2022-09-23 11:16 Xi Ruoyao
  2022-09-23 11:16 ` [PATCH v2 1/1] " Xi Ruoyao
  0 siblings, 1 reply; 5+ messages in thread
From: Xi Ruoyao @ 2022-09-23 11:16 UTC (permalink / raw)
  To: libc-alpha
  Cc: caiyinyu, liuzhensong, Lulu Cheng, Wang Xuerui, Chenghua Xu, Xi Ruoyao

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


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

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-23 11:16 [PATCH v2 0/1] LoongArch: Add static PIE support Xi Ruoyao
2022-09-23 11:16 ` [PATCH v2 1/1] " Xi Ruoyao
2022-09-23 13:23   ` Adhemerval Zanella Netto
2022-09-23 15:24     ` Xi Ruoyao
2022-09-24  1:18   ` liuzhensong

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