]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
xtensa: gcc: add static PIE support
authorMax Filippov <jcmvbkbc@gmail.com>
Sat, 13 Aug 2022 04:02:15 +0000 (21:02 -0700)
committerMax Filippov <jcmvbkbc@gmail.com>
Tue, 6 Sep 2022 12:13:31 +0000 (05:13 -0700)
gcc/
* config/xtensa/linux.h (LINK_SPEC): Add static-pie.

gcc/config/xtensa/linux.h

index 540e4bf538f8d5e2ef908a81fd4b3b0ff248b984..bc7bee71517d2c4ea5e6231590a6b8693d865650 100644 (file)
@@ -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}"