dw2_asm_output_data (1, DW_LNE_end_sequence, NULL);
}
+static unsigned int output_line_info_generation;
+
/* Output the source line number correspondence information. This
information goes into the .debug_line section. */
static void
output_line_info (bool prologue_only)
{
- static unsigned int generation;
char l1[MAX_ARTIFICIAL_LABEL_BYTES], l2[MAX_ARTIFICIAL_LABEL_BYTES];
char p1[MAX_ARTIFICIAL_LABEL_BYTES], p2[MAX_ARTIFICIAL_LABEL_BYTES];
bool saw_one = false;
int opc;
- ASM_GENERATE_INTERNAL_LABEL (l1, LINE_NUMBER_BEGIN_LABEL, generation);
- ASM_GENERATE_INTERNAL_LABEL (l2, LINE_NUMBER_END_LABEL, generation);
- ASM_GENERATE_INTERNAL_LABEL (p1, LN_PROLOG_AS_LABEL, generation);
- ASM_GENERATE_INTERNAL_LABEL (p2, LN_PROLOG_END_LABEL, generation++);
+ ASM_GENERATE_INTERNAL_LABEL (l1, LINE_NUMBER_BEGIN_LABEL,
+ output_line_info_generation);
+ ASM_GENERATE_INTERNAL_LABEL (l2, LINE_NUMBER_END_LABEL,
+ output_line_info_generation);
+ ASM_GENERATE_INTERNAL_LABEL (p1, LN_PROLOG_AS_LABEL,
+ output_line_info_generation);
+ ASM_GENERATE_INTERNAL_LABEL (p2, LN_PROLOG_END_LABEL,
+ output_line_info_generation++);
if (!XCOFF_DEBUGGING_INFO)
{
macinfo_label_base += macinfo_label_base_adj;
}
+/* As init_sections_and_labels may get called multiple times, have a
+ generation count for labels. */
+static unsigned init_sections_and_labels_generation;
+
/* Initialize the various sections and labels for dwarf output and prefix
them with PREFIX if non-NULL. Returns the generation (zero based
number of times function was called). */
static unsigned
init_sections_and_labels (bool early_lto_debug)
{
- /* As we may get called multiple times have a generation count for
- labels. */
- static unsigned generation = 0;
-
if (early_lto_debug)
{
if (!dwarf_split_debug_info)
SECTION_DEBUG | SECTION_EXCLUDE, NULL);
ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_abbrev_section_label,
DEBUG_SKELETON_ABBREV_SECTION_LABEL,
- generation);
+ init_sections_and_labels_generation);
/* Somewhat confusing detail: The skeleton_[abbrev|info] sections
stay in the main .o, but the skeleton_line goes into the split
SECTION_DEBUG | SECTION_EXCLUDE, NULL);
ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_line_section_label,
DEBUG_SKELETON_LINE_SECTION_LABEL,
- generation);
+ init_sections_and_labels_generation);
debug_str_offsets_section
= get_section (DEBUG_LTO_DWO_STR_OFFSETS_SECTION,
SECTION_DEBUG | SECTION_EXCLUDE,
NULL);
ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_info_section_label,
DEBUG_SKELETON_INFO_SECTION_LABEL,
- generation);
+ init_sections_and_labels_generation);
debug_str_dwo_section = get_section (DEBUG_LTO_STR_DWO_SECTION,
DEBUG_STR_DWO_SECTION_FLAGS,
NULL);
debug_line_section = get_section (DEBUG_LTO_LINE_SECTION,
SECTION_DEBUG | SECTION_EXCLUDE, NULL);
ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label,
- DEBUG_LINE_SECTION_LABEL, generation);
+ DEBUG_LINE_SECTION_LABEL,
+ init_sections_and_labels_generation);
debug_str_section = get_section (DEBUG_LTO_STR_SECTION,
DEBUG_STR_SECTION_FLAGS
SECTION_DEBUG, NULL);
ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_abbrev_section_label,
DEBUG_SKELETON_ABBREV_SECTION_LABEL,
- generation);
+ init_sections_and_labels_generation);
/* Somewhat confusing detail: The skeleton_[abbrev|info] sections
stay in the main .o, but the skeleton_line goes into the
SECTION_DEBUG | SECTION_EXCLUDE, NULL);
ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_line_section_label,
DEBUG_SKELETON_LINE_SECTION_LABEL,
- generation);
+ init_sections_and_labels_generation);
debug_str_offsets_section
= get_section (DEBUG_DWO_STR_OFFSETS_SECTION,
SECTION_DEBUG | SECTION_EXCLUDE, NULL);
ASM_GENERATE_INTERNAL_LABEL (debug_skeleton_info_section_label,
DEBUG_SKELETON_INFO_SECTION_LABEL,
- generation);
+ init_sections_and_labels_generation);
debug_loc_section = get_section (dwarf_version >= 5
? DEBUG_DWO_LOCLISTS_SECTION
: DEBUG_DWO_LOC_SECTION,
}
ASM_GENERATE_INTERNAL_LABEL (abbrev_section_label,
- DEBUG_ABBREV_SECTION_LABEL, generation);
+ DEBUG_ABBREV_SECTION_LABEL,
+ init_sections_and_labels_generation);
ASM_GENERATE_INTERNAL_LABEL (debug_info_section_label,
- DEBUG_INFO_SECTION_LABEL, generation);
+ DEBUG_INFO_SECTION_LABEL,
+ init_sections_and_labels_generation);
info_section_emitted = false;
ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label,
- DEBUG_LINE_SECTION_LABEL, generation);
+ DEBUG_LINE_SECTION_LABEL,
+ init_sections_and_labels_generation);
/* There are up to 4 unique ranges labels per generation.
See also output_rnglists. */
ASM_GENERATE_INTERNAL_LABEL (ranges_section_label,
- DEBUG_RANGES_SECTION_LABEL, generation * 4);
+ DEBUG_RANGES_SECTION_LABEL,
+ init_sections_and_labels_generation * 4);
if (dwarf_version >= 5 && dwarf_split_debug_info)
ASM_GENERATE_INTERNAL_LABEL (ranges_base_label,
DEBUG_RANGES_SECTION_LABEL,
- 1 + generation * 4);
+ 1 + init_sections_and_labels_generation * 4);
ASM_GENERATE_INTERNAL_LABEL (debug_addr_section_label,
- DEBUG_ADDR_SECTION_LABEL, generation);
+ DEBUG_ADDR_SECTION_LABEL,
+ init_sections_and_labels_generation);
ASM_GENERATE_INTERNAL_LABEL (macinfo_section_label,
(dwarf_strict && dwarf_version < 5)
? DEBUG_MACINFO_SECTION_LABEL
- : DEBUG_MACRO_SECTION_LABEL, generation);
+ : DEBUG_MACRO_SECTION_LABEL,
+ init_sections_and_labels_generation);
ASM_GENERATE_INTERNAL_LABEL (loc_section_label, DEBUG_LOC_SECTION_LABEL,
- generation);
+ init_sections_and_labels_generation);
- ++generation;
- return generation - 1;
+ ++init_sections_and_labels_generation;
+ return init_sections_and_labels_generation - 1;
}
/* Set up for Dwarf output at the start of compilation. */
base_types.release ();
XDELETEVEC (producer_string);
producer_string = NULL;
+ output_line_info_generation = 0;
+ init_sections_and_labels_generation = 0;
}
#include "gt-dwarf2out.h"