From 4115076d89d75a8ad4673df344645a05ad94c3c3 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 25 Jun 2015 21:31:04 +0000 Subject: [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. * gcc.c (driver_handle_option): Validate -pie if PIE is enabled by default. From-SVN: r224987 --- gcc/ChangeLog | 5 +++++ gcc/gcc.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f65eef75f3..2ca60430fc9 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-06-25 H.J. Lu + + * gcc.c (driver_handle_option): Validate -pie if PIE is enabled + by default. + 2015-06-25 Andrew MacLeod * function.h (ipa_opt_pass, ipa_opt_pass_d): Move forward declarations. diff --git a/gcc/gcc.c b/gcc/gcc.c index d77c6c5692a..0f29b7870fb 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.30.2