static GTY(()) int dw2_string_counter;
static GTY(()) unsigned long dwarf2out_cfi_label_num;
+/* True if the compilation unit places functions in more than one section. */
+static GTY(()) bool have_multiple_function_sections = false;
+
+/* Whether the default text and cold text sections have been used at all. */
+
+static GTY(()) bool text_section_used = false;
+static GTY(()) bool cold_text_section_used = false;
+
+/* The default cold text section. */
+static GTY(()) section *cold_text_section;
+
#if defined (DWARF2_DEBUGGING_INFO) || defined (DWARF2_UNWIND_INFO)
/* Forward declarations for functions defined in this file. */
static HOST_WIDE_INT stack_adjust_offset (const_rtx);
static void output_cfi (dw_cfi_ref, dw_fde_ref, int);
static void output_call_frame_info (int);
+static void dwarf2out_note_section_used (void);
static void dwarf2out_stack_adjust (rtx, bool);
static void flush_queued_reg_saves (void);
static bool clobbers_queued_reg_save (const_rtx);
output_call_frame_info (1);
#endif
}
+
+/* Note that the current function section is being used for code. */
+
+static void
+dwarf2out_note_section_used (void)
+{
+ section *sec = current_function_section ();
+ if (sec == text_section)
+ text_section_used = true;
+ else if (sec == cold_text_section)
+ cold_text_section_used = true;
+}
+
+void
+dwarf2out_switch_text_section (void)
+{
+ dw_fde_ref fde;
+
+ gcc_assert (cfun);
+
+ fde = &fde_table[fde_table_in_use - 1];
+ fde->dw_fde_switched_sections = true;
+ fde->dw_fde_hot_section_label = cfun->hot_section_label;
+ fde->dw_fde_hot_section_end_label = cfun->hot_section_end_label;
+ fde->dw_fde_unlikely_section_label = cfun->cold_section_label;
+ fde->dw_fde_unlikely_section_end_label = cfun->cold_section_end_label;
+ have_multiple_function_sections = true;
+
+ /* Reset the current label on switching text sections, so that we
+ don't attempt to advance_loc4 between labels in different sections. */
+ fde->dw_fde_current_label = NULL;
+
+ /* There is no need to mark used sections when not debugging. */
+ if (cold_text_section != NULL)
+ dwarf2out_note_section_used ();
+}
#endif
\f
/* And now, the subset of the debugging information support code necessary
/* Number of elements in line_info_table currently in use. */
static GTY(()) unsigned line_info_table_in_use;
-/* True if the compilation unit places functions in more than one section. */
-static GTY(()) bool have_multiple_function_sections = false;
-
/* A pointer to the base of a table that contains line information
for each source code line outside of .text in the compilation unit. */
static GTY ((length ("separate_line_info_table_allocated")))
/* Cached result of previous call to lookup_filename. */
static GTY(()) struct dwarf_file_data * file_table_last_lookup;
-/* Whether the default text and cold text sections have been used at
- all. */
-
-static GTY(()) bool text_section_used = false;
-static GTY(()) bool cold_text_section_used = false;
-
-/* The default cold text section. */
-static GTY(()) section *cold_text_section;
-
#ifdef DWARF2_DEBUGGING_INFO
/* Offset from the "steady-state frame pointer" to the frame base,
/* Section flags for .debug_str section. */
#define DEBUG_STR_SECTION_FLAGS \
- (HAVE_GAS_SHF_MERGE && flag_merge_constants \
+ (HAVE_GAS_SHF_MERGE && flag_merge_debug_strings \
? SECTION_DEBUG | SECTION_MERGE | SECTION_STRINGS | 1 \
: SECTION_DEBUG)
*d = new_loc_list (descr, begin, end, section, 0);
}
-/* Note that the current function section is being used for code. */
-
-static void
-dwarf2out_note_section_used (void)
-{
- section *sec = current_function_section ();
- if (sec == text_section)
- text_section_used = true;
- else if (sec == cold_text_section)
- cold_text_section_used = true;
-}
-
-void
-dwarf2out_switch_text_section (void)
-{
- dw_fde_ref fde;
-
- gcc_assert (cfun);
-
- fde = &fde_table[fde_table_in_use - 1];
- fde->dw_fde_switched_sections = true;
- fde->dw_fde_hot_section_label = cfun->hot_section_label;
- fde->dw_fde_hot_section_end_label = cfun->hot_section_end_label;
- fde->dw_fde_unlikely_section_label = cfun->cold_section_label;
- fde->dw_fde_unlikely_section_end_label = cfun->cold_section_end_label;
- have_multiple_function_sections = true;
-
- /* Reset the current label on switching text sections, so that we
- don't attempt to advance_loc4 between labels in different sections. */
- fde->dw_fde_current_label = NULL;
-
- dwarf2out_note_section_used ();
-}
-
/* Output the location list given to us. */
static void