public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Validate -pie if PIE is enabled by default
@ 2015-06-25 11:47 H.J. Lu
  2015-06-25 20:37 ` Joseph Myers
  0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2015-06-25 11:47 UTC (permalink / raw)
  To: gcc-patches; +Cc: Joseph Myers

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Validate -pie if PIE is enabled by default
  2015-06-25 11:47 [PATCH] Validate -pie if PIE is enabled by default H.J. Lu
@ 2015-06-25 20:37 ` Joseph Myers
  0 siblings, 0 replies; 2+ messages in thread
From: Joseph Myers @ 2015-06-25 20:37 UTC (permalink / raw)
  To: H.J. Lu; +Cc: gcc-patches

On Thu, 25 Jun 2015, H.J. Lu wrote:

> 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?

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-25 20:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-25 11:47 [PATCH] Validate -pie if PIE is enabled by default H.J. Lu
2015-06-25 20:37 ` Joseph Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).