]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
defaults.h (EH_FRAME_SECTION, [...]): Define here.
authorJason Merrill <jason@yorick.cygnus.com>
Thu, 9 Sep 1999 21:36:20 +0000 (21:36 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 9 Sep 1999 21:36:20 +0000 (17:36 -0400)
* defaults.h (EH_FRAME_SECTION, EH_FRAME_SECTION_ASM_OP): Define here.
* crtstuff.c: Not here.
* dwarf2out.c: Or here.
* libgcc2.c (__do_global_ctors, __do_global_dtors): Handle EH frame
info.

From-SVN: r29241

gcc/ChangeLog
gcc/crtstuff.c
gcc/defaults.h
gcc/dwarf2out.c
gcc/libgcc2.c

index 5e26b572a7e0ac570363153a9483975201befdd8..27f5f129dcaee900526e7cd6f7a6522a92c1919b 100644 (file)
@@ -1,3 +1,11 @@
+Thu Sep  9 14:23:02 1999  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * defaults.h (EH_FRAME_SECTION, EH_FRAME_SECTION_ASM_OP): Define here.
+       * crtstuff.c: Not here.
+       * dwarf2out.c: Or here.
+       * libgcc2.c (__do_global_ctors, __do_global_dtors): Handle EH frame
+       info.
+
 Thu Sep  9 09:40:58 1999  Mark Mitchell  <mark@codesourcery.com>
 
        * function.h (free_after_compilation): Remove decl parameter.
index ccebde1d2c981082fa22362218d4a93491a5e477..6ce1c863acfe13f847dd6205f43e8ae6bf68b370 100644 (file)
@@ -1,6 +1,6 @@
 /* Specialized bits of code needed to support construction and
    destruction of file-scope objects in C++ code.
-   Copyright (C) 1991, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1991, 1994-1999 Free Software Foundation, Inc.
    Contributed by Ron Guilmette (rfg@monkeys.com).
 
 This file is part of GNU CC.
@@ -108,9 +108,6 @@ extern void *__deregister_frame_info (void *)
 #ifndef DTORS_SECTION_ASM_OP
 #define DTORS_SECTION_ASM_OP   ".section\t.dtors,\"aw\""
 #endif
-#if !defined (EH_FRAME_SECTION_ASM_OP) && defined (DWARF2_UNWIND_INFO) && defined(ASM_OUTPUT_SECTION_NAME)
-#define EH_FRAME_SECTION_ASM_OP        ".section\t.eh_frame,\"aw\""
-#endif
 
 #ifdef OBJECT_FORMAT_ELF
 
index 90d483f308efd4787c0f5c9275ee5ed3228973a2..2fe8cd4772a9b057bbbe6e89443b9e72d70a2bad 100644 (file)
@@ -1,7 +1,7 @@
 /* Definitions of various defaults for how to do assembler output
    (most of which are designed to be appropriate for GAS or for
    some BSD assembler).
-   Copyright (C) 1992, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1996-1999 Free Software Foundation, Inc.
    Contributed by Ron Guilmette (rfg@monkeys.com)
 
 This file is part of GNU CC.
@@ -155,6 +155,19 @@ do { fprintf (FILE, "\t%s\t", ASM_LONG);                           \
 #define DWARF2_UNWIND_INFO 1
 #endif
 
+#if defined (DWARF2_UNWIND_INFO) && !defined (EH_FRAME_SECTION)
+# if defined (EH_FRAME_SECTION_ASM_OP)
+#  define EH_FRAME_SECTION() eh_frame_section();
+# else
+   /* If we aren't using crtstuff to run ctors, don't use it for EH.  */
+#  if defined (ASM_OUTPUT_SECTION_NAME) && defined (ASM_OUTPUT_CONSTRUCTOR)
+#   define EH_FRAME_SECTION_ASM_OP     ".section\t.eh_frame,\"aw\""
+#   define EH_FRAME_SECTION() \
+     do { named_section (NULL_TREE, ".eh_frame", 0); } while (0)
+#  endif
+# endif
+#endif
+
 /* By default, we generate a label at the beginning and end of the
    text section, and compute the size of the text section by
    subtracting the two.  However, on some platforms that doesn't 
index 1d30f0d662ac3db2378fac0148ea4a4cd8918760..a79339c32d1bade76ef61c203cc56619d5005dca 100644 (file)
@@ -1674,24 +1674,6 @@ output_cfi (cfi, fde)
      }
 }
 
-#if !defined (EH_FRAME_SECTION)
-#if defined (EH_FRAME_SECTION_ASM_OP)
-#define EH_FRAME_SECTION() eh_frame_section();
-#else
-#if defined (ASM_OUTPUT_SECTION_NAME)
-#define EH_FRAME_SECTION()                             \
-  do {                                                 \
-      named_section (NULL_TREE, ".eh_frame", 0);       \
-  } while (0)
-#endif
-#endif
-#endif
-
-/* If we aren't using crtstuff to run ctors, don't use it for EH.  */
-#if !defined (HAS_INIT_SECTION) && !defined (INIT_SECTION_ASM_OP)
-#undef EH_FRAME_SECTION
-#endif
-
 /* Output the call frame information used to used to record information
    that relates to calculating the frame pointer, and records the
    location of saved registers.  */
index 6ac41438ecbaf88c23782b24300866445380d298..33481b141286354effcf2bf3be8ce226f9f23a69 100644 (file)
@@ -2836,6 +2836,15 @@ cacheflush (char *beg, int size, int flag)
 #endif
 
 #if !defined (HAS_INIT_SECTION) || !defined (OBJECT_FORMAT_ELF)
+
+/* Some ELF crosses use crtstuff.c to provide __CTOR_LIST__, but use this
+   code to run constructors.  In that case, we need to handle EH here, too.  */
+
+#ifdef EH_FRAME_SECTION
+#include "frame.h"
+extern unsigned char __EH_FRAME_BEGIN__[];
+#endif
+
 /* Run all the global destructors on exit from the program.  */
 
 void
@@ -2851,6 +2860,9 @@ __do_global_dtors ()
       (*(p-1)) ();
     }
 #endif
+#ifdef EH_FRAME_SECTION
+  __deregister_frame_info (__EH_FRAME_BEGIN__);
+#endif
 }
 #endif
 
@@ -2871,6 +2883,12 @@ int *_exit_dummy_ref = &_exit_dummy_decl;
 void
 __do_global_ctors ()
 {
+#ifdef EH_FRAME_SECTION
+  {
+    static struct object object;
+    __register_frame_info (__EH_FRAME_BEGIN__, &object);
+  }
+#endif
   DO_GLOBAL_CTORS_BODY;
   ON_EXIT (__do_global_dtors, 0);
 }