From: Xi Ruoyao <xry111@xry111.site>
To: libc-alpha@sourceware.org
Cc: caiyinyu <caiyinyu@loongson.cn>,
liuzhensong <liuzhensong@loongson.cn>,
Lulu Cheng <chenglulu@loongson.cn>, Wang Xuerui <i@xen0n.name>,
Chenghua Xu <xuchenghua@loongson.cn>,
Xi Ruoyao <xry111@xry111.site>
Subject: [PATCH v3 0/1] LoongArch: Add static PIE support
Date: Sat, 24 Sep 2022 15:45:33 +0800 [thread overview]
Message-ID: <20220924074534.1566173-1-xry111@xry111.site> (raw)
Static PIE allows us to extend the ASLR to cover static executables,
this patch adds static PIE support for LoongArch.
Changes from v2 to v3: check GAS in addition to GCC. Old GAS produces
stack-based relocs and triggers an internal error in the linker when
linking a static PIE.
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 | 48 ++++++++++++++++++++++++++++++++++
sysdeps/loongarch/configure.ac | 36 +++++++++++++++++++++++++
sysdeps/loongarch/start.S | 14 +++++++---
3 files changed, 95 insertions(+), 3 deletions(-)
--
2.37.0
next reply other threads:[~2022-09-24 7:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-24 7:45 Xi Ruoyao [this message]
2022-09-24 7:45 ` [PATCH v3 1/1] " Xi Ruoyao
2022-09-29 13:32 ` caiyinyu
2022-09-30 12:47 ` Xi Ruoyao
2022-09-30 12:54 ` Adhemerval Zanella Netto
2022-09-30 13:55 ` Xi Ruoyao
2022-09-30 20:10 ` Joseph Myers
2022-10-01 13:07 ` Xi Ruoyao
2022-10-02 14:25 ` Xi Ruoyao
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=20220924074534.1566173-1-xry111@xry111.site \
--to=xry111@xry111.site \
--cc=caiyinyu@loongson.cn \
--cc=chenglulu@loongson.cn \
--cc=i@xen0n.name \
--cc=libc-alpha@sourceware.org \
--cc=liuzhensong@loongson.cn \
--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).