public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-4465] RISC-V: add static-pie support
@ 2023-10-08  0:41 Pan Li
  0 siblings, 0 replies; only message in thread
From: Pan Li @ 2023-10-08  0:41 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b20e59f49b51b7baf05e1b727be5da947e617496

commit r14-4465-gb20e59f49b51b7baf05e1b727be5da947e617496
Author: Yanzhang Wang <yanzhang.wang@intel.com>
Date:   Sat Oct 7 19:32:25 2023 +0800

    RISC-V: add static-pie support
    
    We only need to pass options to the linker when static-pie is passed.
    There's another patch to enable static-pie in glibc. And we need to
    enable in GCC first.
    
    gcc/ChangeLog:
    
            * config/riscv/linux.h: Pass the static-pie specific options to
            the linker.
    
    Signed-off-by: Yanzhang Wang <yanzhang.wang@intel.com>

Diff:
---
 gcc/config/riscv/linux.h | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gcc/config/riscv/linux.h b/gcc/config/riscv/linux.h
index 7323ff30f70..8901671ddf6 100644
--- a/gcc/config/riscv/linux.h
+++ b/gcc/config/riscv/linux.h
@@ -55,9 +55,10 @@ along with GCC; see the file COPYING3.  If not see
 %{shared} \
   %{!shared: \
     %{!static: \
-      %{rdynamic:-export-dynamic} \
-      -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
-    %{static:-static}}"
+      %{!static-pie: \
+	%{rdynamic:-export-dynamic} \
+	-dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
+    %{static:-static} %{static-pie:-static -pie --no-dynamic-linker -z text}}"
 
 #define STARTFILE_PREFIX_SPEC 			\
    "/lib" XLEN_SPEC "/" ABI_SPEC "/ "		\

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-08  0:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-08  0:41 [gcc r14-4465] RISC-V: add static-pie support Pan Li

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