aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 6a6e076..660b4e1 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -759,6 +759,17 @@ int flag_delayed_branch;
int flag_pic;
+/* Nonzero if we are compiling position independent code for executable.
+ The value is 1 if we are doing "small" pic; value is 2 if we're doing
+ "large" pic. */
+
+int flag_pie;
+
+/* Nonzero if we are compiling code for a shared library, zero for
+ executable. */
+
+int flag_shlib;
+
/* Set to the default thread-local storage (tls) model to use. */
enum tls_model flag_tls_default = TLS_MODEL_GLOBAL_DYNAMIC;
@@ -1156,6 +1167,9 @@ static const lang_independent_options f_options[] =
{"pic", &flag_pic, 1,
N_("Generate position independent code, if possible") },
{"PIC", &flag_pic, 2, ""},
+ {"pie", &flag_pie, 1,
+ N_("Generate position independent code for executables, if possible") },
+ {"PIE", &flag_pie, 2, ""},
{"exceptions", &flag_exceptions, 1,
N_("Enable exception handling") },
{"unwind-tables", &flag_unwind_tables, 1,
@@ -5338,6 +5352,11 @@ parse_options_and_default_flags (int argc, char **argv)
}
}
+ if (flag_pie)
+ flag_pic = flag_pie;
+ if (flag_pic && !flag_pie)
+ flag_shlib = 1;
+
if (flag_no_inline == 2)
flag_no_inline = 0;
else