From cf4403481dd67ecec1f1faabd8492421d3680a76 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Mon, 15 Apr 1996 01:46:10 -0600 Subject: flags.h (flag_function_sections): Declare. * flags.h (flag_function_sections): Declare. * toplev.c (flag_function_sections): Define. (compile_file): Add warnings when -ffunction-sections is used with -g, or profiling. Disable -ffunction-sections when profiling is used. Add warning when -ffunction-sections is used on a target that doesn't support it. * varasm.c (named_section): Make a copy of the section name in case the original is in temporary storage. (function_section): Set DECL_SECTION_NAME for each function if flag_function_sections is on and the target supports it. * dbxout.c (dbxout_function_end): New function. (dbxout_function): Call dbxout_function_end if using extensions and flag_function_sections is on. * sparc/sysv4.h (ASM_OUTPUT_SECTION_NAME): Prefix a function section's name with ".text%" when -ffunction-sections. From-SVN: r11774 --- gcc/dbxout.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'gcc/dbxout.c') diff --git a/gcc/dbxout.c b/gcc/dbxout.c index cc6b9ca..9831cdd 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -438,6 +438,27 @@ abspath (rel_filename) } #endif /* 0 */ +static int scope_labelno = 0; +static void +dbxout_function_end () +{ + char lscope_label_name[100]; + /* Convert Ltext into the appropriate format for local labels in case + the system doesn't insert underscores in front of user generated + labels. */ + ASM_GENERATE_INTERNAL_LABEL (lscope_label_name, "Lscope", scope_labelno); + ASM_OUTPUT_INTERNAL_LABEL (asmfile, "Lscope", scope_labelno); + scope_labelno++; + + /* By convention, GCC will mark the end of a function with an N_FUN + symbol and an empty string. */ + fprintf (asmfile, "%s \"\",%d,0,0,", ASM_STABS_OP, N_FUN); + assemble_name (asmfile, lscope_label_name); + fputc ('-', asmfile); + assemble_name (asmfile, XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); + fprintf (asmfile, "-1\n"); +} + /* At the beginning of compilation, start writing the symbol table. Initialize `typevec' and output the standard data types of C. */ @@ -2670,5 +2691,9 @@ dbxout_function (decl) #ifdef DBX_OUTPUT_FUNCTION_END DBX_OUTPUT_FUNCTION_END (asmfile, decl); #endif +#ifdef ASM_OUTPUT_SECTION_NAME + if (flag_function_sections && use_gnu_debug_info_extensions) + dbxout_function_end (); +#endif } #endif /* DBX_DEBUGGING_INFO */ -- cgit v1.1