diff options
author | Richard Henderson <rth@redhat.com> | 2001-08-03 18:31:41 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2001-08-03 18:31:41 -0700 |
commit | 7c262518a45491adb8a04f5ec4006dbe957ab7a4 (patch) | |
tree | f3a177e73b80eca5619e6a8d303a81b56c901052 /gcc/dwarf2out.c | |
parent | 4e627c414436df3de424b718f70576abab682e04 (diff) | |
download | gcc-7c262518a45491adb8a04f5ec4006dbe957ab7a4.tar.gz |
target.h (gcc_target): Add asm_out.named_section, section_type_flags, have_named_sections.
* target.h (gcc_target): Add asm_out.named_section,
section_type_flags, have_named_sections.
* target-def.h (TARGET_ASM_NAMED_SECTION): New.
(TARGET_HAVE_NAMED_SECTIONS): New.
(TARGET_SECTION_TYPE_FLAGS): New.
* Makefile.in (toplev.o): Depend on TARGET_H.
(varasm.o, dbxout.o): Likewise.
* c-common.c (decl_attributes): Check targetm.have_named_sections
instead of ifdef ASM_OUTPUT_SECTION_NAME.
* dbxout.c (dbxout_function_decl): Likewise.
(dbxout_function_end): Likewise.
* toplev.c (compile_file): Likewise.
* varasm.c (exception_section): Likewise.
* cp/decl2.c (finish_objects): Likewise.
* defaults.h (EH_FRAME_SECTION): Remove.
(EH_FRAME_SECTION_ASM_OP): Remove.
(EH_FRAME_SECTION_NAME): New.
(UNIQUE_SECTION): Don't depend on ASM_OUTPUT_SECTION_NAME.
(UNIQUE_SECTION_P): Remove.
* dwarf2out.c (SECTION_FORMAT): Remove.
(ASM_OUTPUT_SECTION): Remove.
(output_call_frame_info): Use named_section_flags.
(output_comp_unit, dwarf2out_start_source_file): Likewise.
(dwarf2out_end_source_file, dwarf2out_define): Likewise.
(dwarf2out_undef, dwarf2out_init, dwarf2out_finish): Likewise.
* varasm.c (in_eh_frame, eh_frame_section): Remove.
(named_section_flags): New.
(named_section): Use it and targetm.section_type_flags.
(resolve_unique_section): New.
(assemble_start_function): Use it.
(asm_emit_uninitialised, assemble_variable): Likewise.
(default_section_type_flags): New.
(default_no_named_section, default_elf_asm_named_section): New.
(default_coff_asm_named_section, default_pe_asm_named_section): New.
* output.h: Update varasm.c decls.
(SECTION_*): New flags.
* crtstuff.c: Check EH_FRAME_SECTION_NAME not EH_FRAME_SECTION_ASM_OP.
(__EH_FRAME_BEGIN__, __FRAME_END__): Use attribute section.
* config/elfos.h (UNIQUE_SECTION_P): Remove.
* config/alpha/elf.h, config/arm/linux-elf.h: Likewise.
* config/arm/pe.h, config/arm/unknown-elf.h: Likewise.
* config/i386/cygwin.h, config/i386/djgpp.h: Likewise.
* config/i386/i386-interix.h, config/i386/win32.h: Likewise.
* config/ia64/sysv4.h, config/mcore/mcore-pe.h: Likewise.
* config/mips/elf.h, config/mips/elf64.h: Likewise.
* config/mips/iris6gld.h, config/mips/mips.h: Likewise.
* config/pa/pa64-hpux.h,
* config/elfos.h (ASM_OUTPUT_SECTION_NAME): Remove.
(TARGET_ASM_NAMED_SECTION): New.
* config/psos.h, config/a29k/a29k.h, config/alpha/elf.h: Likewise.
* config/alpha/vms.h, config/arm/coff.h: Likewise.
* config/arm/conix-elf.h, config/arm/elf.h: Likewise.
* config/arm/linux-elf.h, config/arm/pe.h: Likewise.
* config/arm/unknown-elf.h, config/avr/avr.h: Likewise.
* config/c4x/c4x.h, config/h8300/h8300.h: Likewise.
* config/i386/cygwin.h, config/i386/djgpp.h: Likewise.
* config/i386/i386-interix.h, config/i386/i386elf.h : Likewise.
* config/i386/sco5.h, config/i386/win32.h: Likewise.
* config/m68k/coff.h, config/mcore/mcore-pe.h: Likewise.
* config/mcore/mcore.h, config/mips/elf.h: Likewise.
* config/mips/elf64.h, config/mips/iris6.h: Likewise.
* config/mips/netbsd.h, config/mips/openbsd.h: Likewise.
* config/pa/pa64-hpux.h, config/rs6000/sysv4.h: Likewise.
* config/rs6000/xcoff.h, config/sh/sh.h: Likewise.
* config/sparc/sysv4.h: Likewise.
* config/nextstep.h: Error until named sections implemented.
* config/a29k/a29k.c (a29k_asm_named_section): New.
* config/alpha/alpha.c (SECTION_VMS_OVERLAY): New.
(vms_section_type_flags, vms_asm_named_section): New.
* config/arm/arm.c (arm_elf_asm_named_section): New.
* config/avr/avr.c (asm_output_section_name): Remove.
* config/avr/avr-protos.h: Update.
* config/c4x/c4x.c (c4x_asm_named_section): New.
* config/h8300/h8300.c (h8300_asm_named_section): New.
* config/i386/i386.c (sco_asm_named_section): New.
* config/i386/winnt.c (SECTION_PE_SHARED): New.
(i386_pe_section_type_flags): New.
(i386_pe_asm_named_section): New.
* config/i386/i386-protos.h: Update.
* config/m68k/m68k.c (m68k_coff_asm_named_section): New.
* config/mcore/mcore.c (mcore_asm_named_section): New.
* config/mips/mips.c (iris6_asm_named_section): New.
* config/mips/mips.h (ENCODE_SECTION_INFO): Use DECL_ONE_ONLY
instead of UNIQUE_SECTION_P.
* config/rs6000/rs6000.c (rs6000_elf_section_type_flags): New.
(xcoff_asm_named_section): New.
* config/sh/sh.c (sh_asm_named_section): New.
* config/sparc/sparc.c (sparc_elf_asm_named_section): New.
* config/i386/djgpp.h (EH_FRAME_SECTION_ASM_OP): Remove.
* config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP*): Remove.
(EH_FRAME_SECTION_NAME): New.
(EXCEPTION_SECTION): New.
* config/ia64/ia64.h (EH_FRAME_SECTION_ASM_OP): Remove.
(DEBUG_*_SECTION): Remove.
* config/m68k/rtemself.h (EH_FRAME_SECTION_ASM_OP): Remove.
* config/mips/iris6.h (DEBUG_*_SECTION): Remove.
(EH_FRAME_SECTION_ASM_OP): Remove.
* doc/tm.texi (UNIQUE_SECTION_P): Remove.
(ASM_OUTPUT_SECTION_NAME): Remove.
(TARGET_ASM_NAMED_SECTION): New.
(TARGET_HAVE_NAMED_SECTIONS): New.
(TARGET_SECTION_TYPE_FLAGS): New.
(EH_FRAME_SECTION_ASM_OP): Remove.
(EH_FRAME_SECTION_NAME): New.
From-SVN: r44623
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 91 |
1 files changed, 34 insertions, 57 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index bf72954243f..bedbf8ec957 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -277,18 +277,6 @@ static void def_cfa_1 PARAMS ((const char *, dw_cfa_location *)); #define SECTION_ASM_OP "\t.section\t" #endif -/* The default format used by the ASM_OUTPUT_SECTION macro (see below) to - print the SECTION_ASM_OP and the section name. The default here works for - almost all svr4 assemblers, except for the sparc, where the section name - must be enclosed in double quotes. (See sparcv4.h). */ -#ifndef SECTION_FORMAT -#ifdef PUSHSECTION_FORMAT -#define SECTION_FORMAT PUSHSECTION_FORMAT -#else -#define SECTION_FORMAT "%s%s\n" -#endif -#endif - #ifndef DEBUG_FRAME_SECTION #define DEBUG_FRAME_SECTION ".debug_frame" #endif @@ -316,11 +304,6 @@ static void def_cfa_1 PARAMS ((const char *, dw_cfa_location *)); output operations. These may be overridden from within the tm.h file, but typically, that is unnecessary. */ -#ifndef ASM_OUTPUT_SECTION -#define ASM_OUTPUT_SECTION(FILE, SECTION) \ - fprintf ((FILE), SECTION_FORMAT, SECTION_ASM_OP, SECTION) -#endif - #ifdef SET_ASM_OP #ifndef ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL #define ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL(FILE, SY, HI, LO) \ @@ -1753,12 +1736,13 @@ output_call_frame_info (for_eh) if (for_eh) { -#ifdef EH_FRAME_SECTION - EH_FRAME_SECTION (); +#ifdef EH_FRAME_SECTION_NAME + named_section_flags (EH_FRAME_SECTION_NAME, SECTION_WRITE, + DWARF_OFFSET_SIZE); #else tree label = get_file_function_name ('F'); - force_data_section (); + data_section (); ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE)); ASM_GLOBALIZE_LABEL (asm_out_file, IDENTIFIER_POINTER (label)); ASM_OUTPUT_LABEL (asm_out_file, IDENTIFIER_POINTER (label)); @@ -1766,7 +1750,7 @@ output_call_frame_info (for_eh) assemble_label ("__FRAME_BEGIN__"); } else - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_FRAME_SECTION); + named_section_flags (DEBUG_FRAME_SECTION, SECTION_DEBUG, 1); /* Output the CIE. */ ASM_GENERATE_INTERNAL_LABEL (l1, CIE_AFTER_SIZE_LABEL, for_eh); @@ -1984,7 +1968,7 @@ output_call_frame_info (for_eh) ASM_OUTPUT_LABEL (asm_out_file, l2); } -#ifndef EH_FRAME_SECTION +#ifndef EH_FRAME_SECTION_NAME if (for_eh) dw2_asm_output_data (4, 0, "End of Table"); #endif @@ -6336,7 +6320,7 @@ output_comp_unit (die) secname = (const char *) DEBUG_INFO_SECTION; /* Output debugging information. */ - ASM_OUTPUT_SECTION (asm_out_file, secname); + named_section_flags (secname, SECTION_DEBUG, 1); output_compilation_unit_header (); output_die (die); @@ -11574,10 +11558,12 @@ dwarf2out_start_source_file (lineno, filename) } if (debug_info_level >= DINFO_LEVEL_VERBOSE) { - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_MACINFO_SECTION); + named_section_flags (DEBUG_MACINFO_SECTION, SECTION_DEBUG, 1); dw2_asm_output_data (1, DW_MACINFO_start_file, "Start new file"); - dw2_asm_output_data_uleb128 (lineno, "Included from line number %d", lineno); - dw2_asm_output_data_uleb128 (lookup_filename (filename), "Filename we just started"); + dw2_asm_output_data_uleb128 (lineno, "Included from line number %d", + lineno); + dw2_asm_output_data_uleb128 (lookup_filename (filename), + "Filename we just started"); } } @@ -11594,7 +11580,7 @@ dwarf2out_end_source_file (lineno) } if (debug_info_level >= DINFO_LEVEL_VERBOSE) { - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_MACINFO_SECTION); + named_section_flags (DEBUG_MACINFO_SECTION, SECTION_DEBUG, 1); dw2_asm_output_data (1, DW_MACINFO_end_file, "End file"); } } @@ -11616,7 +11602,7 @@ dwarf2out_define (lineno, buffer) } if (debug_info_level >= DINFO_LEVEL_VERBOSE) { - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_MACINFO_SECTION); + named_section_flags (DEBUG_MACINFO_SECTION, SECTION_DEBUG, 1); dw2_asm_output_data (1, DW_MACINFO_define, "Define macro"); dw2_asm_output_data_uleb128 (lineno, "At line number %d", lineno); dw2_asm_output_nstring (buffer, -1, "The macro"); @@ -11634,7 +11620,7 @@ dwarf2out_undef (lineno, buffer) { if (debug_info_level >= DINFO_LEVEL_VERBOSE) { - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_MACINFO_SECTION); + named_section_flags (DEBUG_MACINFO_SECTION, SECTION_DEBUG, 1); dw2_asm_output_data (1, DW_MACINFO_undef, "Undefine macro"); dw2_asm_output_data_uleb128 (lineno, "At line number %d", lineno); dw2_asm_output_nstring (buffer, -1, "The macro"); @@ -11707,26 +11693,27 @@ dwarf2out_init (main_input_filename) ASM_GENERATE_INTERNAL_LABEL (debug_line_section_label, DEBUG_LINE_SECTION_LABEL, 0); ASM_GENERATE_INTERNAL_LABEL (loc_section_label, DEBUG_LOC_SECTION_LABEL, 0); - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LOC_SECTION); + named_section_flags (DEBUG_LOC_SECTION, SECTION_DEBUG, 1); ASM_OUTPUT_LABEL (asm_out_file, loc_section_label); - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_ABBREV_SECTION); + named_section_flags (DEBUG_ABBREV_SECTION, SECTION_DEBUG, 1); ASM_OUTPUT_LABEL (asm_out_file, abbrev_section_label); - if (DWARF2_GENERATE_TEXT_SECTION_LABEL) - { - ASM_OUTPUT_SECTION (asm_out_file, TEXT_SECTION); - ASM_OUTPUT_LABEL (asm_out_file, text_section_label); - } - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_INFO_SECTION); + named_section_flags (DEBUG_INFO_SECTION, SECTION_DEBUG, 1); ASM_OUTPUT_LABEL (asm_out_file, debug_info_section_label); - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LINE_SECTION); + named_section_flags (DEBUG_LINE_SECTION, SECTION_DEBUG, 1); ASM_OUTPUT_LABEL (asm_out_file, debug_line_section_label); if (debug_info_level >= DINFO_LEVEL_VERBOSE) { - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_MACINFO_SECTION); + named_section_flags (DEBUG_MACINFO_SECTION, SECTION_DEBUG, 1); ASM_GENERATE_INTERNAL_LABEL (macinfo_section_label, DEBUG_MACINFO_SECTION_LABEL, 0); ASM_OUTPUT_LABEL (asm_out_file, macinfo_section_label); } + + if (DWARF2_GENERATE_TEXT_SECTION_LABEL) + { + text_section (); + ASM_OUTPUT_LABEL (asm_out_file, text_section_label); + } } /* Output stuff that dwarf requires at the end of every file, @@ -11783,19 +11770,9 @@ dwarf2out_finish (input_filename) add_sibling_attributes (node->die); /* Output a terminator label for the .text section. */ - ASM_OUTPUT_SECTION (asm_out_file, TEXT_SECTION); + text_section (); ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, TEXT_END_LABEL, 0); -#if 0 - /* Output a terminator label for the .data section. */ - ASM_OUTPUT_SECTION (asm_out_file, DATA_SECTION); - ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, DATA_END_LABEL, 0); - - /* Output a terminator label for the .bss section. */ - ASM_OUTPUT_SECTION (asm_out_file, BSS_SECTION); - ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, BSS_END_LABEL, 0); -#endif - /* Output the source line correspondence table. We must do this even if there is no line information. Otherwise, on an empty translation unit, we will generate a present, but empty, @@ -11803,7 +11780,7 @@ dwarf2out_finish (input_filename) examining the file. */ if (! DWARF2_ASM_LINE_DEBUG_INFO) { - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LINE_SECTION); + named_section_flags (DEBUG_LINE_SECTION, SECTION_DEBUG, 1); output_line_info (); } @@ -11834,13 +11811,13 @@ dwarf2out_finish (input_filename) output_comp_unit (comp_unit_die); /* Output the abbreviation table. */ - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_ABBREV_SECTION); + named_section_flags (DEBUG_ABBREV_SECTION, SECTION_DEBUG, 1); output_abbrev_section (); if (pubname_table_in_use) { /* Output public names table. */ - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_PUBNAMES_SECTION); + named_section_flags (DEBUG_PUBNAMES_SECTION, SECTION_DEBUG, 1); output_pubnames (); } @@ -11849,7 +11826,7 @@ dwarf2out_finish (input_filename) if (fde_table_in_use) { /* Output the address range information. */ - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_ARANGES_SECTION); + named_section_flags (DEBUG_ARANGES_SECTION, SECTION_DEBUG, 1); output_aranges (); } @@ -11857,7 +11834,7 @@ dwarf2out_finish (input_filename) if (have_location_lists) { /* Output the location lists info. */ - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LOC_SECTION); + named_section_flags (DEBUG_LOC_SECTION, SECTION_DEBUG, 1); output_location_lists (die); have_location_lists = 0; } @@ -11865,14 +11842,14 @@ dwarf2out_finish (input_filename) /* Output ranges section if necessary. */ if (ranges_table_in_use) { - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_RANGES_SECTION); + named_section_flags (DEBUG_RANGES_SECTION, SECTION_DEBUG, 1); output_ranges (); } /* Have to end the primary source file. */ if (debug_info_level >= DINFO_LEVEL_VERBOSE) { - ASM_OUTPUT_SECTION (asm_out_file, DEBUG_MACINFO_SECTION); + named_section_flags (DEBUG_MACINFO_SECTION, SECTION_DEBUG, 1); dw2_asm_output_data (1, DW_MACINFO_end_file, "End file"); } } |