]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
hurd: Ad default-pie and static-pie support
authorSamuel Thibault <samuel.thibault@gnu.org>
Sat, 6 May 2023 11:55:44 +0000 (13:55 +0200)
committerThomas Schwinge <thomas@codesourcery.com>
Mon, 27 Nov 2023 14:44:53 +0000 (15:44 +0100)
This fixes the Hurd spec in the default-pie case, and adds static-pie
support.

gcc/ChangeLog:

* config/i386/gnu.h: Use PIE_SPEC, add static-pie case.
* config/i386/gnu64.h: Use PIE_SPEC, add static-pie case.

gcc/config/i386/gnu.h
gcc/config/i386/gnu64.h

index 8dc6d9ee4e352bb5e774517fc9b97d7f4a75cf84..e776144f96c7697753b6b7deabb0a2dc293fd7a9 100644 (file)
@@ -27,12 +27,12 @@ along with GCC.  If not, see <http://www.gnu.org/licenses/>.
 #undef STARTFILE_SPEC
 #if defined HAVE_LD_PIE
 #define STARTFILE_SPEC \
-  "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+  "%{!shared: %{pg|p|profile:%{static-pie:grcrt0.o%s;static:gcrt0.o%s;:gcrt1.o%s};static-pie:rcrt0.o%s;static:crt0.o%s;" PIE_SPEC ":Scrt1.o%s;:crt1.o%s}} \
+   crti.o%s %{static:crtbeginT.o%s;shared|static-pie|" PIE_SPEC ":crtbeginS.o%s;:crtbegin.o%s}"
 #else
 #define STARTFILE_SPEC \
   "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};static:crt0.o%s;:crt1.o%s}} \
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+   crti.o%s %{static:crtbeginT.o%s;shared:crtbeginS.o%s;:crtbegin.o%s}"
 #endif
 
 #ifdef TARGET_LIBC_PROVIDES_SSP
index a411f0e802a9bdc4df1d86324cdd5016e7e80300..332372fa0678a0d53540647435b99ed596f68305 100644 (file)
@@ -31,10 +31,10 @@ along with GCC.  If not, see <http://www.gnu.org/licenses/>.
 #undef STARTFILE_SPEC
 #if defined HAVE_LD_PIE
 #define STARTFILE_SPEC \
-  "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+  "%{!shared: %{pg|p|profile:%{static-pie:grcrt0.o%s;static:gcrt0.o%s;:gcrt1.o%s};static-pie:rcrt0.o%s;static:crt0.o%s;" PIE_SPEC ":Scrt1.o%s;:crt1.o%s}} \
+   crti.o%s %{static:crtbeginT.o%s;shared|static-pie|" PIE_SPEC ":crtbeginS.o%s;:crtbegin.o%s}"
 #else
 #define STARTFILE_SPEC \
   "%{!shared: %{pg|p|profile:%{static:gcrt0.o%s;:gcrt1.o%s};static:crt0.o%s;:crt1.o%s}} \
-   crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+   crti.o%s %{static:crtbeginT.o%s;shared|static-pie|" PIE_SPEC ":crtbeginS.o%s;:crtbegin.o%s}"
 #endif