This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Validate -pie if PIE is enabled by default
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Joseph Myers <joseph at codesourcery dot com>
- Date: Thu, 25 Jun 2015 04:40:14 -0700
- Subject: [PATCH] Validate -pie if PIE is enabled by default
- Authentication-results: sourceware.org; auth=none
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