+2017-01-11 Jakub Jelinek <jakub@redhat.com>
+
+ * dwarf2out.c (DWARF_COMPILE_UNIT_HEADER_SIZE): For DWARF5 decrease
+ by 12.
+ (DWARF_COMDAT_TYPE_UNIT_HEADER_SIZE): Always
+ DWARF_COMPILE_UNIT_HEADER_SIZE plus 12.
+ (DWARF_COMPILE_UNIT_SKELETON_HEADER_SIZE): Define.
+ (calc_base_type_die_sizes): Use DWARF_COMPILE_UNIT_SKELETON_HEADER_SIZE
+ for initial die_offset if dwarf_split_debug_info.
+ (output_comp_unit): Use DWARF_COMPILE_UNIT_SKELETON_HEADER_SIZE for
+ initial next_die_offset if dwo_id is non-NULL. Don't emit padding
+ fields.
+ (output_skeleton_debug_sections): Formatting fix. Use
+ DWARF_COMPILE_UNIT_SKELETON_HEADER_SIZE instead of
+ DWARF_COMPILE_UNIT_HEADER_SIZE. Don't emit padding.
+
2017-01-11 Wilco Dijkstra <wdijkstr@arm.com>
* config/arm/cortex-a53.md: Add bypasses for
/* Fixed size portion of the DWARF compilation unit header. */
#define DWARF_COMPILE_UNIT_HEADER_SIZE \
(DWARF_INITIAL_LENGTH_SIZE + DWARF_OFFSET_SIZE \
- + (dwarf_version >= 5 \
- ? 4 + DWARF_TYPE_SIGNATURE_SIZE + DWARF_OFFSET_SIZE : 3))
+ + (dwarf_version >= 5 ? 4 : 3))
/* Fixed size portion of the DWARF comdat type unit header. */
#define DWARF_COMDAT_TYPE_UNIT_HEADER_SIZE \
(DWARF_COMPILE_UNIT_HEADER_SIZE \
- + (dwarf_version >= 5 \
- ? 0 : DWARF_TYPE_SIGNATURE_SIZE + DWARF_OFFSET_SIZE))
+ + DWARF_TYPE_SIGNATURE_SIZE + DWARF_OFFSET_SIZE)
+
+/* Fixed size portion of the DWARF skeleton compilation unit header. */
+#define DWARF_COMPILE_UNIT_SKELETON_HEADER_SIZE \
+ (DWARF_COMPILE_UNIT_HEADER_SIZE + (dwarf_version >= 5 ? 8 : 0))
/* Fixed size portion of public names info. */
#define DWARF_PUBNAMES_HEADER_SIZE (2 * DWARF_OFFSET_SIZE + 2)
static void
calc_base_type_die_sizes (void)
{
- unsigned long die_offset = DWARF_COMPILE_UNIT_HEADER_SIZE;
+ unsigned long die_offset = (dwarf_split_debug_info
+ ? DWARF_COMPILE_UNIT_SKELETON_HEADER_SIZE
+ : DWARF_COMPILE_UNIT_HEADER_SIZE);
unsigned int i;
dw_die_ref base_type;
#if ENABLE_ASSERT_CHECKING
delete extern_map;
/* Initialize the beginning DIE offset - and calculate sizes/offsets. */
- next_die_offset = DWARF_COMPILE_UNIT_HEADER_SIZE;
+ next_die_offset = (dwo_id
+ ? DWARF_COMPILE_UNIT_SKELETON_HEADER_SIZE
+ : DWARF_COMPILE_UNIT_HEADER_SIZE);
calc_die_sizes (die);
oldsym = die->die_id.die_symbol;
if (dwo_id != NULL)
for (int i = 0; i < 8; i++)
dw2_asm_output_data (1, dwo_id[i], i == 0 ? "DWO id" : NULL);
- else
- /* Hope all the padding will be removed for DWARF 5 final for
- DW_AT_compile and DW_AT_partial. */
- dw2_asm_output_data (8, 0, "Padding 1");
-
- dw2_asm_output_data (DWARF_OFFSET_SIZE, 0, "Padding 2");
}
output_die (die);
header. */
if (DWARF_INITIAL_LENGTH_SIZE - DWARF_OFFSET_SIZE == 4)
dw2_asm_output_data (4, 0xffffffff,
- "Initial length escape value indicating 64-bit DWARF extension");
+ "Initial length escape value indicating 64-bit "
+ "DWARF extension");
dw2_asm_output_data (DWARF_OFFSET_SIZE,
- DWARF_COMPILE_UNIT_HEADER_SIZE
+ DWARF_COMPILE_UNIT_SKELETON_HEADER_SIZE
- DWARF_INITIAL_LENGTH_SIZE
+ size_of_die (comp_unit),
"Length of Compilation Unit Info");
if (dwarf_version < 5)
dw2_asm_output_data (1, DWARF2_ADDR_SIZE, "Pointer Size (in bytes)");
else
- {
- for (int i = 0; i < 8; i++)
- dw2_asm_output_data (1, dwo_id[i], i == 0 ? "DWO id" : NULL);
-
- dw2_asm_output_data (DWARF_OFFSET_SIZE, 0, "Padding 2");
- }
+ for (int i = 0; i < 8; i++)
+ dw2_asm_output_data (1, dwo_id[i], i == 0 ? "DWO id" : NULL);
comp_unit->die_abbrev = SKELETON_COMP_DIE_ABBREV;
output_die (comp_unit);