This is the mail archive of the gcc@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]

Re: EH_FRAME_SECTION_NAME failure on AIX


On Mon, Aug 13, 2001 at 03:01:51PM -0400, David Edelsohn wrote:
> Placing the EH tables in a CSECT called "eh_frame".  The info used to be
> placed in the DATA section.

I see.  A nice house of cards I've upset here.

> 	One could place the EH info in a CSECT called "eh_frame[RW]" which
> probably is safe from AIX linker garbage collection because of its
> references to the text section.

No, garbage collection works the other way -- there would have to
be a reference *from* the text section to prevent the data from
being collected.

Try this.


r~


	* config/rs6000/xcoff.h (EH_FRAME_IN_DATA_SECTION): New.
	* defaults.h (EH_FRAME_SECTION_NAME): Respect it.
	* doc/tm.texi (Exception Region Output): Document it.

Index: defaults.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/defaults.h,v
retrieving revision 1.52
diff -c -p -d -r1.52 defaults.h
*** defaults.h	2001/08/12 01:46:14	1.52
--- defaults.h	2001/08/13 20:15:29
*************** do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNA
*** 211,217 ****
  
  /* If we have named sections, and we're using crtstuff to run ctors,
     use them for registering eh frame information.  */
! #if defined (TARGET_ASM_NAMED_SECTION)
  #ifndef EH_FRAME_SECTION_NAME
  #define EH_FRAME_SECTION_NAME ".eh_frame"
  #endif
--- 211,217 ----
  
  /* If we have named sections, and we're using crtstuff to run ctors,
     use them for registering eh frame information.  */
! #if defined (TARGET_ASM_NAMED_SECTION) && !defined(EH_FRAME_IN_DATA_SECTION)
  #ifndef EH_FRAME_SECTION_NAME
  #define EH_FRAME_SECTION_NAME ".eh_frame"
  #endif
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/egcs/gcc/doc/tm.texi,v
retrieving revision 1.46
diff -c -p -d -r1.46 tm.texi
*** tm.texi	2001/08/12 23:34:50	1.46
--- tm.texi	2001/08/13 20:15:29
*************** provide a default definition if the targ
*** 7068,7073 ****
--- 7068,7083 ----
  You should define this symbol if your target supports DWARF 2 frame
  unwind information and the default definition does not work.
  
+ @findex EH_FRAME_IN_DATA_SECTION
+ @item EH_FRAME_IN_DATA_SECTION
+ If defined, DWARF 2 frame unwind information will be placed in the
+ data section even though the target supports named sections.  This
+ might be necessary, for instance, if the system linker does garbage
+ collection and sections cannot be marked as not to be collected.
+ 
+ Do not define this macro unless @code{TARGET_ASM_NAMED_SECTION} is
+ also defined.
+ 
  @findex OMIT_EH_TABLE
  @item OMIT_EH_TABLE ()
  A C expression that is nonzero if the normal exception table output
Index: config/rs6000/xcoff.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/xcoff.h,v
retrieving revision 1.3
diff -c -p -d -r1.3 xcoff.h
*** xcoff.h	2001/08/06 22:17:09	1.3
--- xcoff.h	2001/08/13 20:15:30
*************** toc_section ()						\
*** 492,499 ****
  /* Switch into a generic section.  */
  #define TARGET_ASM_NAMED_SECTION  xcoff_asm_named_section
  
! /* Define the name of the section to use for the exception tables.
!    TODO: test and see if we can use read_only_data_section, if so,
!    remove this.  */
! 
  #define EXCEPTION_SECTION data_section
--- 492,502 ----
  /* Switch into a generic section.  */
  #define TARGET_ASM_NAMED_SECTION  xcoff_asm_named_section
  
! /* 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
+    would otherwise garbage collect these sections.  */
+ #define EH_FRAME_IN_DATA_SECTION 1


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