[PATCH] More -fdebug-types-section + -flto fixes

Richard Biener rguenther@suse.de
Wed Feb 27 13:01:00 GMT 2019


This avoids .debug_types for the late debug where we shouldn't emit
any type DIEs anyway.  This follows the recent change for pubnames.

Bootstrap & regtest running on x86_64-unknown-linux-gnu.

2019-02-27  Richard Biener  <rguenther@suse.de>

	PR debug/88878
	* dwarf2out.c (use_debug_types): Disable when in_lto_p.

Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c	(revision 269250)
+++ gcc/dwarf2out.c	(working copy)
@@ -2914,9 +2914,13 @@ const struct gcc_debug_hooks dwarf2_line
    separate comdat sections since the linker will then be able to
    remove duplicates.  But not all tools support .debug_types sections
    yet.  For Dwarf V5 or higher .debug_types doesn't exist any more,
-   it is DW_UT_type unit type in .debug_info section.  */
-
-#define use_debug_types (dwarf_version >= 4 && flag_debug_types_section)
+   it is DW_UT_type unit type in .debug_info section.  For late LTO
+   debug there should be almost no types emitted so avoid enabling
+   -fdebug-types-section there.  */
+
+#define use_debug_types (dwarf_version >= 4 \
+			 && flag_debug_types_section \
+			 && !in_lto_p)
 
 /* Various DIE's use offsets relative to the beginning of the
    .debug_info section to refer to each other.  */



More information about the Gcc-patches mailing list