}
#endif /* UNALIGNED_INT_ASM_OP */
+/* Output an immediate constant in a given size. */
+
void
dw2_asm_output_data VPARAMS ((int size, unsigned HOST_WIDE_INT value,
const char *comment, ...))
va_end (ap);
}
+/* Output the difference between two symbols in a given size. */
+/* ??? There appear to be assemblers that do not like such
+ subtraction, but do support ASM_SET_OP. It's unfortunately
+ impossible to do here, since the ASM_SET_OP for the difference
+ symbol must appear after both symbols are defined. */
+
void
dw2_asm_output_delta VPARAMS ((int size, const char *lab1, const char *lab2,
const char *comment, ...))
va_end (ap);
}
+/* Output a section-relative reference to a label. In general this
+ can only be done for debugging symbols. E.g. on most targets with
+ the GNU linker, this is accomplished with a direct reference and
+ the knowledge that the debugging section will be placed at VMA 0.
+ Some targets have special relocations for this that we must use. */
+
void
dw2_asm_output_offset VPARAMS ((int size, const char *label,
const char *comment, ...))
comment = va_arg (ap, const char *);
#endif
+#ifdef ASM_OUTPUT_DWARF_OFFSET
+ ASM_OUTPUT_DWARF_OFFSET (asm_out_file, size, label);
+#else
#ifdef UNALIGNED_INT_ASM_OP
fputs (unaligned_integer_asm_op (size), asm_out_file);
assemble_name (asm_out_file, label);
#else
assemble_integer (gen_rtx_SYMBOL_REF (Pmode, label), size, 1);
+#endif
#endif
if (flag_debug_asm && comment)
va_end (ap);
}
+/* Output a self-relative reference to a label, possibly in a
+ different section or object file. */
+
void
dw2_asm_output_pcrel VPARAMS ((int size, const char *label,
const char *comment, ...))
comment = va_arg (ap, const char *);
#endif
+#ifdef ASM_OUTPUT_DWARF_PCREL
+ ASM_OUTPUT_DWARF_PCREL (asm_out_file, size, label);
+#else
#ifdef UNALIGNED_INT_ASM_OP
fputs (unaligned_integer_asm_op (size), asm_out_file);
-
- /* ??? This needs target conditionalization. E.g. the solaris
- assembler uses %r_disp32(label). Others don't like "." and
- we need to generate a temporary label here. */
assemble_name (asm_out_file, label);
fputc ('-', asm_out_file);
fputc ('.', asm_out_file);
#else
abort ();
#endif
+#endif
+
+ if (flag_debug_asm && comment)
+ {
+ fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
+ vfprintf (asm_out_file, comment, ap);
+ }
+ fputc ('\n', asm_out_file);
+
+ va_end (ap);
+}
+
+/* Output an absolute reference to a label. */
+
+void
+dw2_asm_output_addr VPARAMS ((int size, const char *label,
+ const char *comment, ...))
+{
+#ifndef ANSI_PROTOTYPES
+ int size;
+ const char *label;
+ const char *comment;
+#endif
+ va_list ap;
+
+ VA_START (ap, comment);
+
+#ifndef ANSI_PROTOTYPES
+ size = va_arg (ap, int);
+ label = va_arg (ap, const char *);
+ comment = va_arg (ap, const char *);
+#endif
+
+#ifdef UNALIGNED_INT_ASM_OP
+ fputs (unaligned_integer_asm_op (size), asm_out_file);
+ assemble_name (asm_out_file, label);
+#else
+ assemble_integer (gen_rtx_SYMBOL_REF (Pmode, label), size, 1);
+#endif
if (flag_debug_asm && comment)
{
va_end (ap);
}
+/* Similar, but use an RTX expression instead of a text label. */
+
void
dw2_asm_output_addr_rtx VPARAMS ((int size, rtx addr,
const char *comment, ...))
switch (cfi->dw_cfi_opc)
{
case DW_CFA_set_loc:
- dw2_asm_output_offset (DWARF2_ADDR_SIZE,
- cfi->dw_cfi_oprnd1.dw_cfi_addr, NULL);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE,
+ cfi->dw_cfi_oprnd1.dw_cfi_addr, NULL);
break;
case DW_CFA_advance_loc1:
dw2_asm_output_delta (1, cfi->dw_cfi_oprnd1.dw_cfi_addr,
trailing null) so the pointer is 4-byte aligned. The Solaris ld
can't handle unaligned relocs. */
dw2_asm_output_nstring ("eh", -1, "CIE Augmentation");
- dw2_asm_output_offset (DWARF2_ADDR_SIZE, "__EXCEPTION_TABLE__",
- "pointer to exception region info");
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, "__EXCEPTION_TABLE__",
+ "pointer to exception region info");
}
else
{
stripattributes (FRAME_SECTION),
"FDE CIE offset");
- dw2_asm_output_offset (DWARF2_ADDR_SIZE, fde->dw_fde_begin,
- "FDE initial location");
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, fde->dw_fde_begin,
+ "FDE initial location");
dw2_asm_output_delta (DWARF2_ADDR_SIZE, fde->dw_fde_end,
fde->dw_fde_begin, "FDE address range");
break;
case dw_val_class_lbl_id:
- dw2_asm_output_offset (DWARF2_ADDR_SIZE, AT_lbl (a), "%s", name);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, AT_lbl (a), "%s", name);
break;
case dw_val_class_lbl_offset:
dw2_asm_output_data (2, 0, NULL);
}
- dw2_asm_output_offset (DWARF2_ADDR_SIZE, text_section_label, "Address");
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, text_section_label, "Address");
dw2_asm_output_delta (DWARF2_ADDR_SIZE, text_end_label,
text_section_label, "Length");
if (die->die_tag == DW_TAG_subprogram)
{
- dw2_asm_output_offset (DWARF2_ADDR_SIZE, get_AT_low_pc (die),
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, get_AT_low_pc (die),
"Address");
dw2_asm_output_delta (DWARF2_ADDR_SIZE, get_AT_hi_pc (die),
get_AT_low_pc (die), "Length");
dw2_asm_output_data (1, 0, "DW_LNE_set_address");
dw2_asm_output_data_uleb128 (1 + DWARF2_ADDR_SIZE, NULL);
dw2_asm_output_data (1, DW_LNE_set_address, NULL);
- dw2_asm_output_offset (DWARF2_ADDR_SIZE, line_label, NULL);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, line_label, NULL);
}
strcpy (prev_line_label, line_label);
current_file = line_info->dw_file_num;
dw2_asm_output_data (1, DW_LNS_set_file, "DW_LNS_set_file");
dw2_asm_output_data_uleb128 (current_file, "(\"%s\")",
- line_file_table.table[current_file]);
+ file_table.table[current_file]);
}
/* Emit debug info for the current line number, choosing the encoding
dw2_asm_output_data (1, 0, "DW_LNE_set_address");
dw2_asm_output_data_uleb128 (1 + DWARF2_ADDR_SIZE, NULL);
dw2_asm_output_data (1, DW_LNE_set_address, NULL);
- dw2_asm_output_offset (DWARF2_ADDR_SIZE, text_end_label, NULL);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, text_end_label, NULL);
}
dw2_asm_output_data (1, 0, "DW_LNE_end_sequence");
dw2_asm_output_data (1, 0, "DW_LNE_set_address");
dw2_asm_output_data_uleb128 (1 + DWARF2_ADDR_SIZE, NULL);
dw2_asm_output_data (1, DW_LNE_set_address, NULL);
- dw2_asm_output_offset (DWARF2_ADDR_SIZE, line_label, NULL);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, line_label, NULL);
}
else
{
dw2_asm_output_data (1, 0, "DW_LNE_set_address");
dw2_asm_output_data_uleb128 (1 + DWARF2_ADDR_SIZE, NULL);
dw2_asm_output_data (1, DW_LNE_set_address, NULL);
- dw2_asm_output_offset (DWARF2_ADDR_SIZE, line_label, NULL);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, line_label, NULL);
}
}
strcpy (prev_line_label, line_label);
current_file = line_info->dw_file_num;
dw2_asm_output_data (1, DW_LNS_set_file, "DW_LNS_set_file");
dw2_asm_output_data_uleb128 (current_file, "(\"%s\")",
- line_file_table.table[current_file]);
+ file_table.table[current_file]);
}
/* Emit debug info for the current line number, choosing the encoding
dw2_asm_output_data (1, 0, "DW_LNE_set_address");
dw2_asm_output_data_uleb128 (1 + DWARF2_ADDR_SIZE, NULL);
dw2_asm_output_data (1, DW_LNE_set_address, NULL);
- dw2_asm_output_offset (DWARF2_ADDR_SIZE, line_label, NULL);
+ dw2_asm_output_addr (DWARF2_ADDR_SIZE, line_label, NULL);
}
/* Output the marker for the end of this sequence. */