[gcc r13-2499] xtensa: gcc: add static PIE support

Max Filippov jcmvbkbc@gcc.gnu.org
Tue Sep 6 12:14:37 GMT 2022


https://gcc.gnu.org/g:9e0c2696724d4d004ea189a69f15781c7baa68e1

commit r13-2499-g9e0c2696724d4d004ea189a69f15781c7baa68e1
Author: Max Filippov <jcmvbkbc@gmail.com>
Date:   Fri Aug 12 21:02:15 2022 -0700

    xtensa: gcc: add static PIE support
    
    gcc/
            * config/xtensa/linux.h (LINK_SPEC): Add static-pie.

Diff:
---
 gcc/config/xtensa/linux.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h
index 540e4bf538f..bc7bee71517 100644
--- a/gcc/config/xtensa/linux.h
+++ b/gcc/config/xtensa/linux.h
@@ -54,9 +54,10 @@ along with GCC; see the file COPYING3.  If not see
 #define LINK_SPEC \
  "%{shared:-shared} \
   %{!shared: \
-    %{!static: \
+    %{!static:%{!static-pie: \
       %{rdynamic:-export-dynamic} \
-      -dynamic-linker " GNU_USER_DYNAMIC_LINKER "} \
+      -dynamic-linker " GNU_USER_DYNAMIC_LINKER "}} \
+    %{static-pie:-static -pie --no-dynamic-linker -z text} \
     %{static:-static}} \
   %{mabi=windowed:--abi-windowed} \
   %{mabi=call0:--abi-call0}"


More information about the Gcc-cvs mailing list