===================================================================
@@ -672,9 +672,9 @@ proper position among the other output files. */
#ifndef LINK_PIE_SPEC
#ifdef HAVE_LD_PIE
-#define LINK_PIE_SPEC "%{pie:-pie} "
+#define LINK_PIE_SPEC "%{pie:-pie} %{no-pie:}"
#else
-#define LINK_PIE_SPEC "%{pie:} "
+#define LINK_PIE_SPEC "%{pie:} %{no-pie:}"
#endif
#endif
@@ -3135,6 +3135,7 @@ display_help (void)
fputs (_(" -c Compile and assemble, but do not link\n"), stdout);
fputs (_(" -o <file> Place the output into <file>\n"), stdout);
fputs (_(" -pie Create a position independent executable\n"), stdout);
+ fputs (_(" -no-pie Create a position dependent executable\n"), stdout);
fputs (_(" -shared Create a shared library\n"), stdout);
fputs (_("\
-x <language> Specify the language of the following input files\n\
===================================================================
@@ -0,0 +1,7 @@
+/* { dg-do link { target pie } } */
+/* { dg-options "-no-pie" } */
+
+int main(void)
+{
+ return 0;
+}
===================================================================
@@ -462,7 +462,7 @@ Objective-C and Objective-C++ Dialects}.
@item Linker Options
@xref{Link Options,,Options for Linking}.
@gccoptlist{@var{object-file-name} -l@var{library} @gol
--nostartfiles -nodefaultlibs -nostdlib -pie -rdynamic @gol
+-nostartfiles -nodefaultlibs -no-pie -nostdlib -pie -rdynamic @gol
-s -static -static-libgcc -static-libstdc++ @gol
-static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
-shared -shared-libgcc -symbolic @gol
@@ -10574,6 +10574,11 @@ These entries are usually resolved by entries in
libc. These entry points should be supplied through some other
mechanism when this option is specified.
+@item -no-pie
+@opindex no-pie
+Produce a position dependent executable. This is the negative of option
+@option{-pie} which produces a position independent executable.
+
@item -nostdlib
@opindex nostdlib
Do not use the standard system startup files or libraries when linking.
===================================================================
@@ -2841,7 +2841,7 @@ x
Driver Joined Separate
shared
-Driver RejectNegative Negative(pie)
+Driver RejectNegative Negative(no-pie)
Create a shared library
shared-libgcc
@@ -2885,6 +2885,10 @@ Driver
symbolic
Driver
+no-pie
+Driver RejectNegative Negative(pie)
+Create a position dependent executable
+
pie
Driver RejectNegative Negative(shared)
Create a position independent executable