OSDN Git Service

* defaults.h (EH_FRAME_SECTION, EH_FRAME_SECTION_ASM_OP): Define here.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Sep 1999 21:36:20 +0000 (21:36 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 9 Sep 1999 21:36:20 +0000 (21:36 +0000)
* crtstuff.c: Not here.
* dwarf2out.c: Or here.
* libgcc2.c (__do_global_ctors, __do_global_dtors): Handle EH frame
info.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29241 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 5e26b57..27f5f12 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 ccebde1..6ce1c86 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 90d483f..2fe8cd4 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 1d30f0d..a79339c 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 6ac4143..33481b1 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);
 }