This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

PATCH: Target hooks for exception and eh frame sections


This is a longish but conceptually simple patch to generalize the
generation of sections for exceptions and frames.  The immediate
motivation is Darwin and Mach-O, which as usual is more flexible
than a.out but less so than ELF.  In particular, Mach-O has named
sections but limits their number (256) and name (16 chars max).
So have_named_sections can't be enabled.  However, we can still
have eh frame sections, they just have to be issued with an unusual
syntax, so this patch introduces a target hook for it.  Since all
this stuff is connected, I also converted EXCEPTION_SECTION to be
a target hook, cleared out the last refs to EH_FRAME_SECTION_ASM_OP,
and fixed some problems in sco5 and nextstep that kept me from build
testing.

Bootstrapped on powerpc-apple-darwin1.3.7, build tested and output
visually inspected for i386-sco3.2v5, m68-nextstep3 (both of which
have been broken for awhile - nextstep needs additional patches not
listed here), and powerpc-eabi.  OK to commit?

Stan


2001-10-19  Stan Shebs  <shebs@apple.com>

	* target.h (struct gcc_target): Add asm_out.exception_section,
	asm_out.eh_frame_section.
	* target-def.h (TARGET_ASM_EXCEPTION_SECTION): New macro.
	(TARGET_ASM_EH_FRAME_SECTION): New.
	(TARGET_INITIALIZER): Update.
	* output.h (default_exception_section): Declare.
	(default_eh_frame_section): Declare.
	* dwarf2out.c: Include target.h.
	(output_call_frame_info): Call target hook for eh frames.
	(default_eh_frame_section): New function.
	* except.c: Include target.h.
	(output_function_exception_table): Call target hook for exception
	section.
	* varasm.c (default_exception_section): Rename from
	exception_section, remove EXCEPTION_SECTION macro.

	* config/darwin.h (darwin_eh_frame_section): New function.
	(EXCEPTION_SECTION): Remove.
	(TARGET_ASM_EXCEPTION_SECTION): Define.
	* config/nextstep.h (EH_FRAME_SECTION_ASM_OP): Remove.
	(nextstep_exception_section): New function.
	(nextstep_eh_frame_section): New function.
	(TARGET_ASM_EXCEPTION_SECTION): Define.
	(TARGET_ASM_EH_FRAME_SECTION): Define.

	* config/i386/i386-protos.h (ix86_svr3_exception_section):
	Declare.
	* config/i386/i386.c (ix86_svr3_asm_out_constructor): Fix ifdefs.
	(sco_asm_out_constructor): Fix typo.
	(ix86_svr3_exception_section): New function.
	* config/i386/sco5.h (EH_FRAME_SECTION_ASM_OP): Remove reference.
	(EXCEPTION_SECTION): Remove.
	(TARGET_ASM_EXCEPTION_SECTION): Define.
	* config/pa/som.h (EXCEPTION_SECTION): Remove.
	(TARGET_ASM_EXCEPTION_SECTION): Define.
	* config/rs6000/sysv4.h, config/rs6000/xcoff.h
	(EXCEPTION_SECTION): Remove.
	(TARGET_ASM_EXCEPTION_SECTION): Define.
	* config/stormy16/stormy16.h: Remove comments referencing
	EXCEPTION_SECTION and EH_FRAME_SECTION_ASM_OP.

	* doc/tm.texi: Document TARGET_ASM_EXCEPTION_SECTION and
	TARGET_ASM_EH_FRAME_SECTION.

Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.318
diff -c -3 -p -r1.318 dwarf2out.c
*** dwarf2out.c	2001/10/11 23:26:08	1.318
--- dwarf2out.c	2001/10/19 20:56:28
*************** Software Foundation, 59 Temple Place - S
*** 59,64 ****
--- 59,65 ----
  #include "tm_p.h"
  #include "diagnostic.h"
  #include "debug.h"
+ #include "target.h"
  
  #ifdef DWARF2_DEBUGGING_INFO
  static void dwarf2out_source_line	PARAMS ((unsigned int, const char *));
*************** output_call_frame_info (for_eh)
*** 1737,1754 ****
      app_enable ();
  
    if (for_eh)
!     {
! #ifdef EH_FRAME_SECTION_NAME
!       named_section_flags (EH_FRAME_SECTION_NAME, SECTION_WRITE);
! #else
!       tree label = get_file_function_name ('F');
! 
!       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));
! #endif
!     }
    else
      named_section_flags (DEBUG_FRAME_SECTION, SECTION_DEBUG);
  
--- 1739,1745 ----
      app_enable ();
  
    if (for_eh)
!     (*targetm.asm_out.eh_frame_section) ();
    else
      named_section_flags (DEBUG_FRAME_SECTION, SECTION_DEBUG);
  
*************** output_call_frame_info (for_eh)
*** 1975,1980 ****
--- 1966,1986 ----
    /* Turn off app to make assembly quicker.  */
    if (flag_debug_asm)
      app_disable ();
+ }
+ 
+ void
+ default_eh_frame_section ()
+ {
+ #ifdef EH_FRAME_SECTION_NAME
+   named_section_flags (EH_FRAME_SECTION_NAME, SECTION_WRITE);
+ #else
+   tree label = get_file_function_name ('F');
+ 
+   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));
+ #endif
  }
  
  /* Output a marker (i.e. a label) for the beginning of a function, before
Index: except.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/except.c,v
retrieving revision 1.195
diff -c -3 -p -r1.195 except.c
*** except.c	2001/10/09 14:03:10	1.195
--- except.c	2001/10/19 20:56:30
*************** Software Foundation, 59 Temple Place - S
*** 69,76 ****
  #include "intl.h"
  #include "ggc.h"
  #include "tm_p.h"
  
- 
  /* Provide defaults for stuff that may not be defined when using
     sjlj exceptions.  */
  #ifndef EH_RETURN_STACKADJ_RTX
--- 69,76 ----
  #include "intl.h"
  #include "ggc.h"
  #include "tm_p.h"
+ #include "target.h"
  
  /* Provide defaults for stuff that may not be defined when using
     sjlj exceptions.  */
  #ifndef EH_RETURN_STACKADJ_RTX
*************** output_function_exception_table ()
*** 3518,3524 ****
    /* Note that varasm still thinks we're in the function's code section.
       The ".endp" directive that will immediately follow will take us back.  */
  #else
!   exception_section ();
  #endif
  
    have_tt_data = (VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data) > 0
--- 3518,3524 ----
    /* Note that varasm still thinks we're in the function's code section.
       The ".endp" directive that will immediately follow will take us back.  */
  #else
!   (*targetm.asm_out.exception_section) ();
  #endif
  
    have_tt_data = (VARRAY_ACTIVE_SIZE (cfun->eh->ttype_data) > 0
Index: output.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/output.h,v
retrieving revision 1.82
diff -c -3 -p -r1.82 output.h
*** output.h	2001/10/11 18:48:31	1.82
--- output.h	2001/10/19 20:56:34
*************** extern void named_section		PARAMS ((tree
*** 205,211 ****
  extern void function_section		PARAMS ((tree));
  
  /* Tell assembler to switch to the section for the exception table.  */
! extern void exception_section		PARAMS ((void));
  
  /* Tell assembler to switch to the section for string merging.  */
  extern void mergeable_string_section	PARAMS ((tree, unsigned HOST_WIDE_INT,
--- 205,214 ----
  extern void function_section		PARAMS ((tree));
  
  /* Tell assembler to switch to the section for the exception table.  */
! extern void default_exception_section	PARAMS ((void));
! 
! /* Tell assembler to switch to the section for the EH frames.  */
! extern void default_eh_frame_section	PARAMS ((void));
  
  /* Tell assembler to switch to the section for string merging.  */
  extern void mergeable_string_section	PARAMS ((tree, unsigned HOST_WIDE_INT,
Index: target-def.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/target-def.h,v
retrieving revision 1.14
diff -c -3 -p -r1.14 target-def.h
*** target-def.h	2001/09/21 01:26:52	1.14
--- target-def.h	2001/10/19 20:56:34
*************** Foundation, 59 Temple Place - Suite 330,
*** 72,77 ****
--- 72,85 ----
  #define TARGET_HAVE_NAMED_SECTIONS false
  #endif
  
+ #ifndef TARGET_ASM_EXCEPTION_SECTION
+ #define TARGET_ASM_EXCEPTION_SECTION default_exception_section
+ #endif
+ 
+ #ifndef TARGET_ASM_EH_FRAME_SECTION
+ #define TARGET_ASM_EH_FRAME_SECTION default_eh_frame_section
+ #endif
+ 
  #define TARGET_ASM_OUT {TARGET_ASM_OPEN_PAREN,			\
  			TARGET_ASM_CLOSE_PAREN,			\
  			TARGET_ASM_FUNCTION_PROLOGUE,		\
*************** Foundation, 59 Temple Place - Suite 330,
*** 79,84 ****
--- 87,94 ----
  			TARGET_ASM_FUNCTION_BEGIN_EPILOGUE,	\
  			TARGET_ASM_FUNCTION_EPILOGUE,		\
  			TARGET_ASM_NAMED_SECTION,		\
+ 			TARGET_ASM_EXCEPTION_SECTION,		\
+ 			TARGET_ASM_EH_FRAME_SECTION,		\
  			TARGET_ASM_CONSTRUCTOR,			\
  			TARGET_ASM_DESTRUCTOR}
  
Index: target.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/target.h,v
retrieving revision 1.16
diff -c -3 -p -r1.16 target.h
*** target.h	2001/09/21 01:26:52	1.16
--- target.h	2001/10/19 20:56:34
*************** struct gcc_target
*** 68,73 ****
--- 68,79 ----
         specified by FLAGS.  */
      void (* named_section) PARAMS ((const char *, unsigned int));
  
+     /* Switch to the section that holds the exception table.  */
+     void (* exception_section) PARAMS ((void));
+ 
+     /* Switch to the section that holds the exception frames.  */
+     void (* eh_frame_section) PARAMS ((void));
+ 
      /* Output a constructor for a symbol with a given priority.  */
      void (* constructor) PARAMS ((rtx, int));
  
Index: varasm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/varasm.c,v
retrieving revision 1.220
diff -c -3 -p -r1.220 varasm.c
*** varasm.c	2001/10/19 19:42:46	1.220
--- varasm.c	2001/10/19 20:56:37
*************** variable_section (decl, reloc)
*** 603,620 ****
     table.  */
  
  void
! exception_section ()
  {
- #if defined (EXCEPTION_SECTION)
-   EXCEPTION_SECTION ();
- #else
    if (targetm.have_named_sections)
      named_section (NULL_TREE, ".gcc_except_table", 0);
    else if (flag_pic)
      data_section ();
    else
      readonly_data_section ();
- #endif
  }
  
  /* Tell assembler to switch to the section for string merging.  */
--- 603,616 ----
     table.  */
  
  void
! default_exception_section ()
  {
    if (targetm.have_named_sections)
      named_section (NULL_TREE, ".gcc_except_table", 0);
    else if (flag_pic)
      data_section ();
    else
      readonly_data_section ();
  }
  
  /* Tell assembler to switch to the section for string merging.  */
Index: config/darwin.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/darwin.h,v
retrieving revision 1.16
diff -c -3 -p -r1.16 darwin.h
*** darwin.h	2001/10/16 23:22:27	1.16
--- darwin.h	2001/10/19 20:56:39
*************** do { if (!strcmp (alias_name, name))				
*** 352,358 ****
    in_machopic_lazy_symbol_ptr,				\
    in_machopic_symbol_stub,				\
    in_machopic_picsymbol_stub,				\
!   in_darwin_exception, \
    num_sections
  
  #undef	EXTRA_SECTION_FUNCTIONS
--- 358,364 ----
    in_machopic_lazy_symbol_ptr,				\
    in_machopic_symbol_stub,				\
    in_machopic_picsymbol_stub,				\
!   in_darwin_exception, in_darwin_eh_frame,		\
    num_sections
  
  #undef	EXTRA_SECTION_FUNCTIONS
*************** SECTION_FUNCTION (machopic_picsymbol_stu
*** 460,465 ****
--- 466,474 ----
  SECTION_FUNCTION (darwin_exception_section,		\
  		in_darwin_exception,			\
  		".section __TEXT,__gcc_except_tab", 0)	\
+ SECTION_FUNCTION (darwin_eh_frame_section,		\
+ 		in_darwin_eh_frame,			\
+ 		".section __TEXT,__eh_frame", 0)	\
  							\
  void						\
  objc_section_init ()				\
*************** enum machopic_addr_class {
*** 781,788 ****
        }								\
    } while (0)
  
! #define EXCEPTION_SECTION() darwin_exception_section ()
  
  #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)  \
    (((CODE) == 1 || (GLOBAL) == 0) ? DW_EH_PE_pcrel : DW_EH_PE_absptr)
  
--- 790,799 ----
        }								\
    } while (0)
  
! #define TARGET_ASM_EXCEPTION_SECTION darwin_exception_section
  
+ #define TARGET_ASM_EH_FRAME_SECTION darwin_eh_frame_section
+   
  #define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL)  \
    (((CODE) == 1 || (GLOBAL) == 0) ? DW_EH_PE_pcrel : DW_EH_PE_absptr)
  
Index: config/nextstep.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/nextstep.h,v
retrieving revision 1.16
diff -c -3 -p -r1.16 nextstep.h
*** nextstep.h	2001/09/11 16:49:57	1.16
--- nextstep.h	2001/10/19 20:56:39
*************** Boston, MA 02111-1307, USA.  */
*** 214,229 ****
  
  #define TARGET_ASM_CONSTRUCTOR  nextstep_asm_out_constructor
  #define TARGET_ASM_DESTRUCTOR   nextstep_asm_out_destructor
  extern void nextstep_asm_out_constructor  PARAMS ((struct rtx_def *, int));
  extern void nextstep_asm_out_destructor  PARAMS ((struct rtx_def *, int));
  
! /* ??? Should be changed to EH_FRAME_SECTION_NAME, but that requires
!    named section support.  Based on this definition, it seems clear
!    that the object file format supports named sections, but it has
!    not been implemented in gcc.  */
! #error "Implement named section support"
! #define EH_FRAME_SECTION_ASM_OP "\t.section __TEXT,__eh_frame,regular"
  
  /* Don't output a .file directive.  That is only used by the assembler for
     error reporting.  */
  #undef	ASM_FILE_START
--- 214,224 ----
  
  #define TARGET_ASM_CONSTRUCTOR  nextstep_asm_out_constructor
  #define TARGET_ASM_DESTRUCTOR   nextstep_asm_out_destructor
  
! #define TARGET_ASM_EXCEPTION_SECTION nextstep_exception_section
  
+ #define TARGET_ASM_EH_FRAME_SECTION nextstep_eh_frame_section
+   
  /* Don't output a .file directive.  That is only used by the assembler for
     error reporting.  */
  #undef	ASM_FILE_START
*************** FUNCTION ()								\
*** 326,331 ****
--- 321,327 ----
  #define EXTRA_SECTIONS					\
    in_const, in_cstring, in_literal4, in_literal8,	\
    in_constructor, in_destructor,			\
+   in_nextstep_exception, in_nextstep_eh_frame,		\
    in_objc_class, in_objc_meta_class, in_objc_category,	\
    in_objc_class_vars, in_objc_instance_vars,		\
    in_objc_cls_meth, in_objc_inst_meth,			\
*************** SECTION_FUNCTION (constructor_section,		
*** 357,362 ****
--- 353,364 ----
  SECTION_FUNCTION (destructor_section,		\
  		  in_destructor,		\
  		  ".destructor", 0, 0)		\
+ SECTION_FUNCTION (nextstep_exception_section,	\
+ 		  in_nextstep_exception,	\
+ 		  ".section __TEXT,__gcc_except_tab,regular", 0, 0)	\
+ SECTION_FUNCTION (nextstep_eh_frame_section,	\
+ 		  in_nextstep_eh_frame,		\
+ 		  ".section __TEXT,__eh_frame,regular", 0, 0)		\
  SECTION_FUNCTION (objc_class_section,		\
  		  in_objc_class,		\
  		  ".objc_class", 0, 1)		\
Index: config/i386/i386-protos.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386-protos.h,v
retrieving revision 1.64
diff -c -3 -p -r1.64 i386-protos.h
*** i386-protos.h	2001/10/17 01:39:46	1.64
--- i386-protos.h	2001/10/19 20:56:40
*************** extern unsigned int i386_pe_section_type
*** 196,198 ****
--- 196,201 ----
  							int));
  extern void i386_pe_asm_named_section PARAMS ((const char *, unsigned int));
  #endif
+ 
+ extern void ix86_svr3_exception_section PARAMS ((void));
+ 
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.319
diff -c -3 -p -r1.319 i386.c
*** i386.c	2001/10/17 01:39:46	1.319
--- i386.c	2001/10/19 20:56:45
*************** const struct attribute_spec ix86_attribu
*** 692,701 ****
  static tree ix86_handle_cdecl_attribute PARAMS ((tree *, tree, tree, int, bool *));
  static tree ix86_handle_regparm_attribute PARAMS ((tree *, tree, tree, int, bool *));
  
- #ifdef DO_GLOBAL_CTORS_BODY
- static void ix86_svr3_asm_out_constructor PARAMS ((rtx, int));
- #endif
  #if defined(TARGET_ELF) && defined(TARGET_COFF)
  static void sco_asm_named_section PARAMS ((const char *, unsigned int));
  static void sco_asm_out_constructor PARAMS ((rtx, int));
  #endif
--- 692,699 ----
  static tree ix86_handle_cdecl_attribute PARAMS ((tree *, tree, tree, int, bool *));
  static tree ix86_handle_regparm_attribute PARAMS ((tree *, tree, tree, int, bool *));
  
  #if defined(TARGET_ELF) && defined(TARGET_COFF)
+ static void ix86_svr3_asm_out_constructor PARAMS ((rtx, int));
  static void sco_asm_named_section PARAMS ((const char *, unsigned int));
  static void sco_asm_out_constructor PARAMS ((rtx, int));
  #endif
*************** ix86_memory_move_cost (mode, class, in)
*** 12519,12525 ****
      }
  }
  
! #ifdef DO_GLOBAL_CTORS_BODY
  static void
  ix86_svr3_asm_out_constructor (symbol, priority)
       rtx symbol;
--- 12517,12523 ----
      }
  }
  
! #if defined(TARGET_ELF) && defined(TARGET_COFF)
  static void
  ix86_svr3_asm_out_constructor (symbol, priority)
       rtx symbol;
*************** ix86_svr3_asm_out_constructor (symbol, p
*** 12530,12538 ****
    assemble_name (asm_out_file, XSTR (symbol, 0));
    fputc ('\n', asm_out_file);
  }
- #endif
  
- #if defined(TARGET_ELF) && defined(TARGET_COFF)
  static void
  sco_asm_named_section (name, flags)
       const char *name;
--- 12528,12534 ----
*************** sco_asm_out_constructor (symbol, priorit
*** 12550,12557 ****
       int priority;
  {
    if (TARGET_ELF)
!     default_named_section_asm_out_constrctor (symbol, priority);
    else
      ix86_svr3_asm_out_constructor (symbol, priority);
  }
  #endif
--- 12546,12563 ----
       int priority;
  {
    if (TARGET_ELF)
!     default_named_section_asm_out_constructor (symbol, priority);
    else
      ix86_svr3_asm_out_constructor (symbol, priority);
+ }
+ 
+ /* For SVR3.2 release 5, we rename 'gcc_except_table' to the shorter
+    name, in preparation for the day when we're ready to do DWARF2 EH
+    unwinding under COFF.  */
+ 
+ void
+ ix86_svr3_exception_section ()
+ {
+   named_section (NULL, ".gccexc", 1);
  }
  #endif
Index: config/i386/sco5.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/sco5.h,v
retrieving revision 1.53
diff -c -3 -p -r1.53 sco5.h
*** sco5.h	2001/10/17 01:39:47	1.53
--- sco5.h	2001/10/19 20:56:46
*************** Boston, MA 02111-1307, USA.  */
*** 77,83 ****
  #undef GLOBAL_ASM_OP
  #define GLOBAL_ASM_OP			"\t.globl\t"
  
- #undef EH_FRAME_SECTION_ASM_OP
  #define EH_FRAME_SECTION_NAME_COFF	".ehfram"
  #define EH_FRAME_SECTION_NAME_ELF	".eh_frame"
  #define EH_FRAME_SECTION_NAME	\
--- 77,82 ----
*************** do {									\
*** 408,418 ****
  #undef USER_LABEL_PREFIX
  #define USER_LABEL_PREFIX ""
  
! /* 
!  * We rename 'gcc_except_table' to the shorter name in preparation
!  * for the day when we're ready to do DWARF2 eh unwinding under COFF.
!  */
! #define EXCEPTION_SECTION()		named_section (NULL, ".gccexc", 1)
  
  /* Switch into a generic section.  */
  #undef TARGET_ASM_NAMED_SECTION
--- 407,413 ----
  #undef USER_LABEL_PREFIX
  #define USER_LABEL_PREFIX ""
  
! #define TARGET_ASM_EXCEPTION_SECTION ix86_svr3_exception_section
  
  /* Switch into a generic section.  */
  #undef TARGET_ASM_NAMED_SECTION
Index: config/pa/som.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/som.h,v
retrieving revision 1.24
diff -c -3 -p -r1.24 som.h
*** som.h	2001/09/24 16:30:28	1.24
--- som.h	2001/10/19 20:56:48
*************** do {  \
*** 265,271 ****
     complain.
  
     So, we force exception information into the data section.  */
! #define EXCEPTION_SECTION data_section
  
  /* Define the .bss section for ASM_OUTPUT_LOCAL to use. */
  
--- 265,271 ----
     complain.
  
     So, we force exception information into the data section.  */
! #define TARGET_ASM_EXCEPTION_SECTION data_section
  
  /* Define the .bss section for ASM_OUTPUT_LOCAL to use. */
  
Index: config/rs6000/sysv4.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/sysv4.h,v
retrieving revision 1.63
diff -c -3 -p -r1.63 sysv4.h
*** sysv4.h	2001/09/17 23:24:52	1.63
--- sysv4.h	2001/10/19 20:56:49
*************** ncrtn.o%s"
*** 1548,1552 ****
     ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
     : DW_EH_PE_absptr)
  
! #define EXCEPTION_SECTION readonly_data_section
  #define DOUBLE_INT_ASM_OP "\t.quad\t"
--- 1548,1553 ----
     ? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
     : DW_EH_PE_absptr)
  
! #define TARGET_ASM_EXCEPTION_SECTION readonly_data_section
! 
  #define DOUBLE_INT_ASM_OP "\t.quad\t"
Index: config/rs6000/xcoff.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/xcoff.h,v
retrieving revision 1.6
diff -c -3 -p -r1.6 xcoff.h
*** xcoff.h	2001/10/11 17:37:21	1.6
--- xcoff.h	2001/10/19 20:56:49
*************** toc_section ()						\
*** 495,501 ****
  
  /* Define the name of the section to use for the EH language specific
     data areas (.gcc_except_table on most other systems).  */
! #define EXCEPTION_SECTION data_section
  
  /* Define to prevent DWARF2 unwind info in the data section rather
     than in the .eh_frame section.  We do this because the AIX linker
--- 495,501 ----
  
  /* Define the name of the section to use for the EH language specific
     data areas (.gcc_except_table on most other systems).  */
! #define TARGET_ASM_EXCEPTION_SECTION data_section
  
  /* Define to prevent DWARF2 unwind info in the data section rather
     than in the .eh_frame section.  We do this because the AIX linker
Index: config/stormy16/stormy16.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/stormy16/stormy16.h,v
retrieving revision 1.12
diff -c -3 -p -r1.12 stormy16.h
*** stormy16.h	2001/10/19 14:03:29	1.12
--- stormy16.h	2001/10/19 20:56:54
*************** do {									\
*** 4497,4519 ****
     This macro need not be defined on most platforms.  */
  /* #define ASM_OUTPUT_EH_REGION_END() */
  
- /* A C expression to switch to the section in which the main exception table is
-    to be placed.  The default is a section named `.gcc_except_table' on machines
-    that support named sections via `ASM_OUTPUT_SECTION_NAME', otherwise if `-fpic'
-    or `-fPIC' is in effect, the `data_section', otherwise the
-    `readonly_data_section'.  */
- /* #define EXCEPTION_SECTION() */
- 
- /* If defined, a C string constant for the assembler operation to switch to the
-    section for exception handling frame unwind information.  If not defined,
-    GNU CC will provide a default definition if the target supports named
-    sections.  `crtstuff.c' uses this macro to switch to the appropriate
-    section.
- 
-    You should define this symbol if your target supports DWARF 2 frame unwind
-    information and the default definition does not work.  */
- /* #define EH_FRAME_SECTION_ASM_OP */
- 
  /* A C expression that is nonzero if the normal exception table output should
     be omitted.
  
--- 4497,4502 ----
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.65
diff -c -3 -p -r1.65 tm.texi
*** tm.texi	2001/10/17 20:39:09	1.65
--- tm.texi	2001/10/19 20:57:07
*************** A C expression to output text to mark th
*** 7151,7165 ****
  
  This macro need not be defined on most platforms.
  
- @findex EXCEPTION_SECTION
- @item EXCEPTION_SECTION ()
- A C expression to switch to the section in which the main
- exception table is to be placed (@pxref{Sections}).  The default is a
- section named @code{.gcc_except_table} on machines that support named
- sections via @code{TARGET_ASM_NAMED_SECTION}, otherwise if @option{-fpic}
- or @option{-fPIC} is in effect, the @code{data_section}, otherwise the
- @code{readonly_data_section}.
- 
  @findex EH_FRAME_SECTION_NAME
  @item EH_FRAME_SECTION_NAME
  If defined, a C string constant for the name of the section containing
--- 7151,7156 ----
*************** minimum alignment otherwise.  @xref{SDB 
*** 7231,7236 ****
--- 7222,7245 ----
  the target supports DWARF 2 frame unwind information.
  
  @end table
+ 
+ @deftypefn {Target Hook} void TARGET_ASM_EXCEPTION_SECTION ()
+ If defined, a function that switches to the section in which the main
+ exception table is to be placed (@pxref{Sections}).  The default is a
+ function that switches to a section named @code{.gcc_except_table} on
+ machines that support named sections via
+ @code{TARGET_ASM_NAMED_SECTION}, otherwise if @option{-fpic} or
+ @option{-fPIC} is in effect, the @code{data_section}, otherwise the
+ @code{readonly_data_section}.
+ @end deftypefn
+ 
+ @deftypefn {Target Hook} void TARGET_ASM_EH_FRAME_SECTION ()
+ If defined, a function that switches to the section in which the DWARF 2
+ frame unwind information to be placed (@pxref{Sections}).  The default
+ is a function that outputs a standard GAS section directive, if
+ @code{EH_FRAME_SECTION_NAME} is defined, or else a data section
+ directive followed by a synthetic label.
+ @end deftypefn
  
  @node Alignment Output
  @subsection Assembler Commands for Alignment


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]