dwarf2out.c (DWARF_COMPILE_UNIT_HEADER_SIZE): Adjust for -gdwarf-5.
authorJan Kratochvil <jan.kratochvil@redhat.com>
Mon, 31 Oct 2016 21:46:33 +0000 (21:46 +0000)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 31 Oct 2016 21:46:33 +0000 (22:46 +0100)
* dwarf2out.c (DWARF_COMPILE_UNIT_HEADER_SIZE): Adjust for -gdwarf-5.
(DWARF_COMDAT_TYPE_UNIT_HEADER_SIZE): Likewise.

Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r241725

gcc/ChangeLog
gcc/dwarf2out.c

index cdb09d22a4b07e164ca8271651efc9794dcaff2d..b862943e2740a9eb475fe8e0d8cd35d6e45bffbb 100644 (file)
@@ -1,3 +1,9 @@
+2016-10-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
+           Jakub Jelinek  <jakub@redhat.com>
+
+       * dwarf2out.c (DWARF_COMPILE_UNIT_HEADER_SIZE): Adjust for -gdwarf-5.
+       (DWARF_COMDAT_TYPE_UNIT_HEADER_SIZE): Likewise.
+
 2016-10-31  Jakub Jelinek  <jakub@redhat.com>
 
        * dwarf2out.c (dwarf_AT): Handle DW_AT_dwo_name.
index 8259ae0cfe8eeba682c91d13ae0abe290e569044..a6da7a314eed3bd3cf6a3a73baa8b32685de5f1d 100644 (file)
@@ -2983,12 +2983,15 @@ skeleton_chain_node;
 
 /* Fixed size portion of the DWARF compilation unit header.  */
 #define DWARF_COMPILE_UNIT_HEADER_SIZE \
-  (DWARF_INITIAL_LENGTH_SIZE + DWARF_OFFSET_SIZE + 3)
+  (DWARF_INITIAL_LENGTH_SIZE + DWARF_OFFSET_SIZE                       \
+   + (dwarf_version >= 5                                               \
+      ? 4 + DWARF_TYPE_SIGNATURE_SIZE + DWARF_OFFSET_SIZE : 3))
 
 /* Fixed size portion of the DWARF comdat type unit header.  */
 #define DWARF_COMDAT_TYPE_UNIT_HEADER_SIZE \
-  (DWARF_COMPILE_UNIT_HEADER_SIZE + DWARF_TYPE_SIGNATURE_SIZE \
-   + DWARF_OFFSET_SIZE)
+  (DWARF_COMPILE_UNIT_HEADER_SIZE                                      \
+   + (dwarf_version >= 5                                               \
+      ? 0 : DWARF_TYPE_SIGNATURE_SIZE + DWARF_OFFSET_SIZE))
 
 /* Fixed size portion of public names info.  */
 #define DWARF_PUBNAMES_HEADER_SIZE (2 * DWARF_OFFSET_SIZE + 2)