summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2016-03-17 11:07:10 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2016-03-17 11:07:10 +0000
commit21dae9f707008039d857697c3263d55b74627b49 (patch)
tree20821b0ae8514bf944facf2b9ea5b63d7a2b720a
parent9b60ef2111fb6540afa49b536f4f0f98d52c8f5c (diff)
downloadgcc-21dae9f707008039d857697c3263d55b74627b49.tar.gz
Set flag_pic to flag_pie for PIE in LTO
Since PIE implies PIC, we should set flag_pic to flag_pie for PIE in LTO. PR lto/70258 * lto-lang.c (lto_post_options): Set flag_pic to flag_pie for PIE. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234284 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/lto/ChangeLog6
-rw-r--r--gcc/lto/lto-lang.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 7a298d6edf0..dbb69a2e076 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,9 @@
+2016-03-17 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR lto/70258
+ * lto-lang.c (lto_post_options): Set flag_pic to flag_pie for
+ PIE.
+
2016-03-08 Jakub Jelinek <jakub@redhat.com>
* lto-symtab.h (lto_symtab_prevail_decl): Fix spelling
diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c
index 691e9e20905..b5efe3aab7e 100644
--- a/gcc/lto/lto-lang.c
+++ b/gcc/lto/lto-lang.c
@@ -836,7 +836,7 @@ lto_post_options (const char **pfilename ATTRIBUTE_UNUSED)
/* If -fPIC or -fPIE was used at compile time, be sure that
flag_pie is 2. */
flag_pie = MAX (flag_pie, flag_pic);
- flag_pic = 0;
+ flag_pic = flag_pie;
break;
case LTO_LINKER_OUTPUT_EXEC: /* Normal executable */