diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-03-16 01:14:47 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-03-16 01:14:47 +0000 |
commit | 19e5668c98c813e2ca11ed29ee00fdcaba1a89e9 (patch) | |
tree | 683b0a77ec6ee6a85377d17c7a5e1ca1b24cede2 /gcc/dwarf2asm.c | |
parent | 6b917287e08b430ec472330e38cd1711111c7b5d (diff) | |
download | gcc-19e5668c98c813e2ca11ed29ee00fdcaba1a89e9.tar.gz |
* dwarf2asm.c (dw2_asm_output_offset): Use ASM_OUTPUT_DWARF_OFFSET
if provided by the target.
(dw2_asm_output_pcrel): Likewise with ASM_OUTPUT_DWARF_PCREL.
(dw2_asm_output_addr): New.
* dwarf2asm.h (dw2_asm_output_addr): Declare.
* dwarf2out.c (output_cfi): Use it for program addresses.
(output_call_frame_info, output_die): Likewise.
(output_aranges, output_line_info): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40524 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2asm.c')
-rw-r--r-- | gcc/dwarf2asm.c | 69 |
1 files changed, 65 insertions, 4 deletions
diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c index ca1efb547b7..464c2b17946 100644 --- a/gcc/dwarf2asm.c +++ b/gcc/dwarf2asm.c @@ -91,6 +91,8 @@ unaligned_integer_asm_op (size) } #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, ...)) @@ -127,6 +129,12 @@ dw2_asm_output_data VPARAMS ((int size, unsigned HOST_WIDE_INT value, 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, ...)) @@ -169,6 +177,12 @@ dw2_asm_output_delta VPARAMS ((int size, const char *lab1, const char *lab2, 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, ...)) @@ -188,12 +202,16 @@ dw2_asm_output_offset VPARAMS ((int size, const char *label, 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) { @@ -205,6 +223,9 @@ dw2_asm_output_offset VPARAMS ((int size, const char *label, 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, ...)) @@ -224,18 +245,56 @@ dw2_asm_output_pcrel VPARAMS ((int size, const char *label, 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) { @@ -247,6 +306,8 @@ dw2_asm_output_pcrel VPARAMS ((int size, const char *label, 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, ...)) |