summaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 4d866cd1b17..2c8f9a24223 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -403,6 +403,11 @@ int flag_no_function_cse = 0;
int flag_omit_frame_pointer = 0;
+/* Nonzero means place each function into its own section on those platforms
+ which support arbitrary section names and unlimited numbers of sections. */
+
+int flag_function_sections = 0;
+
/* Nonzero to inhibit use of define_optimization peephole opts. */
int flag_no_peephole = 0;
@@ -564,6 +569,7 @@ struct { char *string; int *variable; int on_value;} f_options[] =
{"fast-math", &flag_fast_math, 1},
{"common", &flag_no_common, 0},
{"inhibit-size-directive", &flag_inhibit_size_directive, 1},
+ {"function-sections", &flag_function_sections, 1},
{"verbose-asm", &flag_verbose_asm, 1},
{"gnu-linker", &flag_gnu_linker, 1},
{"pack-struct", &flag_pack_struct, 1},
@@ -2187,6 +2193,24 @@ compile_file (name)
ASM_IDENTIFY_LANGUAGE (asm_out_file);
#endif
+#ifndef ASM_OUTPUT_SECTION_NAME
+ if (flag_function_sections)
+ {
+ warning ("-ffunction-sections not supported for this target.");
+ flag_function_sections = 0;
+ }
+#endif
+
+ if (flag_function_sections
+ && (profile_flag || profile_block_flag))
+ {
+ warning ("-ffunction-sections disabled; it makes profiling impossible.");
+ flag_function_sections = 0;
+ }
+
+ if (flag_function_sections && write_symbols != NO_DEBUG)
+ warning ("-ffunction-sections may affect debugging on some targets.");
+
if (output_bytecode)
{
if (profile_flag || profile_block_flag)