From 8628bc67f12fbbe9e5d4072ff3b1e28f57b3ef8e Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 31 Oct 2016 21:46:33 +0000 Subject: [PATCH] dwarf2out.c (DWARF_COMPILE_UNIT_HEADER_SIZE): Adjust for -gdwarf-5. * dwarf2out.c (DWARF_COMPILE_UNIT_HEADER_SIZE): Adjust for -gdwarf-5. (DWARF_COMDAT_TYPE_UNIT_HEADER_SIZE): Likewise. Co-Authored-By: Jakub Jelinek From-SVN: r241725 --- gcc/ChangeLog | 6 ++++++ gcc/dwarf2out.c | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cdb09d22a4b..b862943e274 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-10-31 Jan Kratochvil + Jakub Jelinek + + * dwarf2out.c (DWARF_COMPILE_UNIT_HEADER_SIZE): Adjust for -gdwarf-5. + (DWARF_COMDAT_TYPE_UNIT_HEADER_SIZE): Likewise. + 2016-10-31 Jakub Jelinek * dwarf2out.c (dwarf_AT): Handle DW_AT_dwo_name. diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 8259ae0cfe8..a6da7a314ee 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -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) -- 2.30.2