This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Validate -pie if PIE is enabled by default


When PIE is enabled by default, -pie is treated as nop in driver.  We
should simply validate it, instead of issue an error.

OK for trunk?

Thanks.

H.J.
---
	* gcc.c (driver_handle_option): Validate -pie if PIE is enabled
	by default.
---
 gcc/gcc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/gcc.c b/gcc/gcc.c
index d77c6c5..0f29b78 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3893,6 +3893,11 @@ driver_handle_option (struct gcc_options *opts,
       save_switch ("-o", 1, &arg, validated, true);
       return true;
 
+#ifdef ENABLE_DEFAULT_PIE
+    case OPT_pie:
+      /* -pie is turned on by default.  */
+#endif
+
     case OPT_static_libgcc:
     case OPT_shared_libgcc:
     case OPT_static_libgfortran:
-- 
2.1.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]