===================================================================
@@ -1123,6 +1123,7 @@ run_gcc (unsigned argc, char *argv[])
append_compiler_options (&argv_obstack, fdecoded_options,
fdecoded_options_count);
append_linker_options (&argv_obstack, decoded_options, decoded_options_count);
+ obstack_ptr_grow (&argv_obstack, "-gno-split-dwarf");
/* Scan linker driver arguments for things that are of relevance to us. */
for (j = 1; j < decoded_options_count; ++j)
===================================================================
@@ -11105,7 +11105,8 @@ add_top_level_skeleton_die_attrs (dw_die
add_skeleton_AT_string (die, dwarf_AT (DW_AT_dwo_name), dwo_file_name);
if (comp_dir != NULL)
add_skeleton_AT_string (die, DW_AT_comp_dir, comp_dir);
- add_AT_pubnames (die);
+ if (!get_AT (die, DW_AT_GNU_pubnames))
+ add_AT_pubnames (die);
add_AT_lineptr (die, DW_AT_GNU_addr_base, debug_addr_section_label);
}
@@ -31811,11 +31812,8 @@ dwarf2out_early_finish (const char *file
note_variable_value (node->die);
/* The AT_pubnames attribute needs to go in all skeleton dies, including
- both the main_cu and all skeleton TUs. Making this call unconditional
- would end up either adding a second copy of the AT_pubnames attribute, or
- requiring a special case in add_top_level_skeleton_die_attrs. */
- if (!dwarf_split_debug_info)
- add_AT_pubnames (comp_unit_die ());
+ both the main_cu and all skeleton TUs. */
+ add_AT_pubnames (comp_unit_die ());
/* The early debug phase is now finished. */
early_dwarf_finished = true;
@@ -31824,6 +31822,11 @@ dwarf2out_early_finish (const char *file
if (!flag_generate_lto && !flag_generate_offload)
return;
+ /* For the early LTO DWARF we do not want split DWARF because it really
+ doesn't make much sense. */
+ int saved_dwarf_split_debug_info = dwarf_split_debug_info;
+ dwarf_split_debug_info = 0;
+
/* Now as we are going to output for LTO initialize sections and labels
to the LTO variants. We don't need a random-seed postfix as other
LTO sections as linking the LTO debug sections into one in a partial
@@ -31858,12 +31861,6 @@ dwarf2out_early_finish (const char *file
save_macinfo_strings ();
- if (dwarf_split_debug_info)
- {
- unsigned int index = 0;
- debug_str_hash->traverse_noresize<unsigned int *, index_string> (&index);
- }
-
/* Output all of the compilation units. We put the main one last so that
the offsets are available to output_pubnames. */
for (limbo_die_node *node = limbo_die_list; node; node = node->next)
@@ -31884,9 +31881,7 @@ dwarf2out_early_finish (const char *file
attributes. */
if (debug_info_level >= DINFO_LEVEL_TERSE)
add_AT_lineptr (ctnode->root_die, DW_AT_stmt_list,
- (!dwarf_split_debug_info
- ? debug_line_section_label
- : debug_skeleton_line_section_label));
+ debug_line_section_label);
output_comdat_type_unit (ctnode);
*slot = ctnode;
@@ -31939,6 +31934,8 @@ dwarf2out_early_finish (const char *file
/* Switch back to the text section. */
switch_to_section (text_section);
+
+ dwarf_split_debug_info = saved_dwarf_split_debug_info;
}
/* Reset all state within dwarf2out.c so that we can rerun the compiler