From ea913779b0921886a8d8503263f27e3ddfc1831b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 17 Mar 2016 11:07:10 +0000 Subject: 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. From-SVN: r234284 --- gcc/lto/ChangeLog | 6 ++++++ gcc/lto/lto-lang.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'gcc/lto') diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 7a298d6..dbb69a2 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2016-03-17 H.J. Lu + + PR lto/70258 + * lto-lang.c (lto_post_options): Set flag_pic to flag_pie for + PIE. + 2016-03-08 Jakub Jelinek * lto-symtab.h (lto_symtab_prevail_decl): Fix spelling diff --git a/gcc/lto/lto-lang.c b/gcc/lto/lto-lang.c index 691e9e2..b5efe3a 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 */ -- cgit v1.1