This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: A patch for crtstuff.c
- To: jason at cygnus dot com (Jason Merrill)
- Subject: Re: A patch for crtstuff.c
- From: hjl at lucon dot org (H.J. Lu)
- Date: Fri, 11 Dec 1998 14:05:16 -0800 (PST)
- Cc: egcs-patches at cygnus dot com
>
> Why !CRTSTUFFS_O? Does that mean "not used in a shared library"? Why
> would that make a difference? Wouldn't the shared library find a defn of
> __foo_frame_info in the executable or another library just fine?
>
> Jason
>
Ok. Here is the new patch.
Thanks.
--
H.J. Lu (hjl@gnu.org)
----
Fri Dec 11 08:00:57 1998 H.J. Lu (hjl@gnu.org)
* crtstuff.c (__register_frame_info, __deregister_frame_info):
If SUPPORTS_WEAK is none zero, make them weak and check if they
are none-zero before calling them.
--- ../../../import/egcs/gcc/crtstuff.c Tue Jul 14 07:16:05 1998
+++ ./crtstuff.c Fri Dec 11 08:59:56 1998
@@ -80,6 +80,11 @@
#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\""
+
+#if SUPPORTS_WEAK
+#pragma weak __register_frame_info
+#pragma weak __deregister_frame_info
+#endif
#endif
#ifdef OBJECT_FORMAT_ELF
@@ -142,7 +147,10 @@
}
#ifdef EH_FRAME_SECTION_ASM_OP
- __deregister_frame_info (__EH_FRAME_BEGIN__);
+#if SUPPORTS_WEAK
+ if (__deregister_frame_info)
+#endif
+ __deregister_frame_info (__EH_FRAME_BEGIN__);
#endif
completed = 1;
}
@@ -170,7 +178,10 @@
frame_dummy ()
{
static struct object object;
- __register_frame_info (__EH_FRAME_BEGIN__, &object);
+#if SUPPORTS_WEAK
+ if (__register_frame_info)
+#endif
+ __register_frame_info (__EH_FRAME_BEGIN__, &object);
}
static void __attribute__ ((__unused__))
@@ -254,7 +265,10 @@
(*p) ();
#ifdef EH_FRAME_SECTION_ASM_OP
- __deregister_frame_info (__EH_FRAME_BEGIN__);
+#if SUPPORTS_WEAK
+ if (__deregister_frame_info)
+#endif
+ __deregister_frame_info (__EH_FRAME_BEGIN__);
#endif
}
@@ -266,7 +280,10 @@
__frame_dummy ()
{
static struct object object;
- __register_frame_info (__EH_FRAME_BEGIN__, &object);
+#if SUPPORTS_WEAK
+ if (__register_frame_info)
+#endif
+ __register_frame_info (__EH_FRAME_BEGIN__, &object);
}
#endif
#endif