From 4dd7c3b285daf030da0ff9c0d5e2f79b24943d1e Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Fri, 8 Aug 2014 20:33:26 +0000 Subject: [PATCH] Remove skeleton type units that were being produced with -gsplit-dwarf. These sections were originally intended as targets for .gdb_index entries that needed to point to type units. Because of the limitations of the .debug_gnu_pubnames/pubtypes sections with split DWARF, we were not able to pass along enough information to the gold linker to generate those index entries properly, and they had to point to the CU instead. GDB had to deal with that, and was updated a while ago to no longer depend on the skeleton TU sections at all. This allows us to reduce object file sizes with split DWARF by about 30%. gcc/ * dwarf2out.c (get_skeleton_type_unit): Remove. (output_skeleton_debug_sections): Remove skeleton type units. (output_comdat_type_unit): Likewise. (dwarf2out_finish): Likewise. From-SVN: r213765 --- gcc/ChangeLog | 7 +++++++ gcc/dwarf2out.c | 55 ------------------------------------------------- 2 files changed, 7 insertions(+), 55 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7519b766ad1..4be17717d74 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-08-08 Cary Coutant + + * dwarf2out.c (get_skeleton_type_unit): Remove. + (output_skeleton_debug_sections): Remove skeleton type units. + (output_comdat_type_unit): Likewise. + (dwarf2out_finish): Likewise. + 2014-08-07 Yi Yang * predict.c (expr_expected_value_1): Remove the redundant assignment. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index f90329b00cf..c1aaa8a87f8 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -9069,26 +9069,6 @@ add_top_level_skeleton_die_attrs (dw_die_ref die) add_AT_lineptr (die, DW_AT_GNU_addr_base, debug_addr_section_label); } -/* Return the single type-unit die for skeleton type units. */ - -static dw_die_ref -get_skeleton_type_unit (void) -{ - /* For dwarf_split_debug_sections with use_type info, all type units in the - skeleton sections have identical dies (but different headers). This - single die will be output many times. */ - - static dw_die_ref skeleton_type_unit = NULL; - - if (skeleton_type_unit == NULL) - { - skeleton_type_unit = new_die (DW_TAG_type_unit, NULL, NULL); - add_top_level_skeleton_die_attrs (skeleton_type_unit); - skeleton_type_unit->die_abbrev = SKELETON_TYPE_DIE_ABBREV; - } - return skeleton_type_unit; -} - /* Output skeleton debug sections that point to the dwo file. */ static void @@ -9127,8 +9107,6 @@ output_skeleton_debug_sections (dw_die_ref comp_unit) ASM_OUTPUT_LABEL (asm_out_file, debug_skeleton_abbrev_section_label); output_die_abbrevs (SKELETON_COMP_DIE_ABBREV, comp_unit); - if (use_debug_types) - output_die_abbrevs (SKELETON_TYPE_DIE_ABBREV, get_skeleton_type_unit ()); dw2_asm_output_data (1, 0, "end of skeleton .debug_abbrev"); } @@ -9190,38 +9168,6 @@ output_comdat_type_unit (comdat_type_node *node) output_die (node->root_die); unmark_dies (node->root_die); - -#if defined (OBJECT_FORMAT_ELF) - if (dwarf_split_debug_info) - { - /* Produce the skeleton type-unit header. */ - const char *secname = ".debug_types"; - - targetm.asm_out.named_section (secname, - SECTION_DEBUG | SECTION_LINKONCE, - comdat_key); - if (DWARF_INITIAL_LENGTH_SIZE - DWARF_OFFSET_SIZE == 4) - dw2_asm_output_data (4, 0xffffffff, - "Initial length escape value indicating 64-bit DWARF extension"); - - dw2_asm_output_data (DWARF_OFFSET_SIZE, - DWARF_COMPILE_UNIT_HEADER_SIZE - - DWARF_INITIAL_LENGTH_SIZE - + size_of_die (get_skeleton_type_unit ()) - + DWARF_TYPE_SIGNATURE_SIZE + DWARF_OFFSET_SIZE, - "Length of Type Unit Info"); - dw2_asm_output_data (2, dwarf_version, "DWARF version number"); - dw2_asm_output_offset (DWARF_OFFSET_SIZE, - debug_skeleton_abbrev_section_label, - debug_abbrev_section, - "Offset Into Abbrev. Section"); - dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Pointer Size (in bytes)"); - output_signature (node->signature, "Type Signature"); - dw2_asm_output_data (DWARF_OFFSET_SIZE, 0, "Offset to Type DIE"); - - output_die (get_skeleton_type_unit ()); - } -#endif } /* Return the DWARF2/3 pubname associated with a decl. */ @@ -24430,7 +24376,6 @@ dwarf2out_finish (const char *filename) skeleton die attrs are added when the skeleton type unit is created, so ensure it is created by this point. */ add_top_level_skeleton_die_attrs (main_comp_unit_die); - (void) get_skeleton_type_unit (); htab_traverse_noresize (debug_str_hash, index_string, &index); } -- 2.30.2