aboutsummaryrefslogtreecommitdiff
path: root/libgcc
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2014-08-19 15:22:59 +0000
committerKai Tietz <ktietz@gcc.gnu.org>2014-08-19 17:22:59 +0200
commit25efdb9f926ae203b89168293e38bc48b85fc20f (patch)
treeef3547031c0e3ad7bb00a76cbb7dfdb7fb40264d /libgcc
parent301f44023e0c46542329b5f77763685529a46267 (diff)
downloadgcc-25efdb9f926ae203b89168293e38bc48b85fc20f.zip
gcc-25efdb9f926ae203b89168293e38bc48b85fc20f.tar.gz
gcc-25efdb9f926ae203b89168293e38bc48b85fc20f.tar.bz2
cygming-crtend.c (register_frame_ctor): Move atexit call from here...
2014-08-19 Yaakov Selkowitz <yselkowi@redhat.com> * config/i386/cygming-crtend.c (register_frame_ctor): Move atexit call from here... * config/i386/cygming-crtbegin.c (__gcc_register_frame): to here. (__dso_handle): Define on Cygwin. * config/i386/t-cygming (crtbeginS.o): New rule. * config.host (*-*-cygwin*): Add crtbeginS.o to extra_parts. From-SVN: r214162
Diffstat (limited to 'libgcc')
-rw-r--r--libgcc/ChangeLog7
-rw-r--r--libgcc/config.host4
-rw-r--r--libgcc/config/i386/cygming-crtbegin.c24
-rw-r--r--libgcc/config/i386/cygming-crtend.c6
-rw-r--r--libgcc/config/i386/t-cygming3
5 files changed, 36 insertions, 8 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog
index cdca13a..c9f4e12 100644
--- a/libgcc/ChangeLog
+++ b/libgcc/ChangeLog
@@ -1,5 +1,12 @@
2014-08-19 Yaakov Selkowitz <yselkowi@redhat.com>
+ * config/i386/cygming-crtend.c (register_frame_ctor): Move atexit
+ call from here...
+ * config/i386/cygming-crtbegin.c (__gcc_register_frame): to here.
+ (__dso_handle): Define on Cygwin.
+ * config/i386/t-cygming (crtbeginS.o): New rule.
+ * config.host (*-*-cygwin*): Add crtbeginS.o to extra_parts.
+
* config/i386/cygming-crtbegin.c (deregister_frame_fn): Fix
declaration syntax.
diff --git a/libgcc/config.host b/libgcc/config.host
index 54fe538..0550c34 100644
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -614,7 +614,7 @@ i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
i[4567]86-wrs-vxworks|i[4567]86-wrs-vxworksae)
;;
i[34567]86-*-cygwin*)
- extra_parts="crtbegin.o crtend.o crtfastmath.o"
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o"
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
if test x$enable_sjlj_exceptions = xyes; then
tmake_eh_file="i386/t-sjlj-eh"
@@ -630,7 +630,7 @@ i[34567]86-*-cygwin*)
tmake_file="${tmake_file} ${tmake_eh_file} ${tmake_dlldir_file} i386/t-slibgcc-cygming i386/t-cygming i386/t-cygwin i386/t-crtfm i386/t-chkstk t-dfprules"
;;
x86_64-*-cygwin*)
- extra_parts="crtbegin.o crtend.o crtfastmath.o"
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtfastmath.o"
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
if test x$enable_sjlj_exceptions = xyes; then
tmake_eh_file="i386/t-sjlj-eh"
diff --git a/libgcc/config/i386/cygming-crtbegin.c b/libgcc/config/i386/cygming-crtbegin.c
index dde9f2a..3e8ed22 100644
--- a/libgcc/config/i386/cygming-crtbegin.c
+++ b/libgcc/config/i386/cygming-crtbegin.c
@@ -111,6 +111,23 @@ static void *__JCR_LIST__[]
= { };
#endif
+#ifdef __CYGWIN__
+/* Declare the __dso_handle variable. It should have a unique value
+ in every shared-object; in a main program its value is zero. The
+ object should in any case be protected. This means the instance
+ in one DSO or the main program is not used in another object. The
+ dynamic linker takes care of this. */
+
+#ifdef CRTSTUFFS_O
+extern void *__ImageBase;
+void *__dso_handle = &__ImageBase;
+#else
+void *__dso_handle = 0;
+#endif
+
+#endif /* __CYGWIN__ */
+
+
/* Pull in references from libgcc.a(unwind-dw2-fde.o) in the
startfile. These are referenced by a ctor and dtor in crtend.o. */
extern void __gcc_register_frame (void);
@@ -161,6 +178,13 @@ __gcc_register_frame (void)
register_class_fn (__JCR_LIST__);
}
#endif
+
+#if DEFAULT_USE_CXA_ATEXIT
+ /* If we use the __cxa_atexit method to register C++ dtors
+ at object construction, also use atexit to register eh frame
+ info cleanup. */
+ atexit(__gcc_deregister_frame);
+#endif /* DEFAULT_USE_CXA_ATEXIT */
}
void
diff --git a/libgcc/config/i386/cygming-crtend.c b/libgcc/config/i386/cygming-crtend.c
index de0d61f..d3beaf9 100644
--- a/libgcc/config/i386/cygming-crtend.c
+++ b/libgcc/config/i386/cygming-crtend.c
@@ -70,12 +70,6 @@ static void
register_frame_ctor (void)
{
__gcc_register_frame ();
-#if DEFAULT_USE_CXA_ATEXIT
- /* If we use the __cxa_atexit method to register C++ dtors
- at object construction, also use atexit to register eh frame
- info cleanup. */
- atexit (__gcc_deregister_frame);
-#endif
}
#if !DEFAULT_USE_CXA_ATEXIT
diff --git a/libgcc/config/i386/t-cygming b/libgcc/config/i386/t-cygming
index d76004c..4713b7f 100644
--- a/libgcc/config/i386/t-cygming
+++ b/libgcc/config/i386/t-cygming
@@ -8,6 +8,9 @@ CUSTOM_CRTSTUFF = yes
crtbegin.o: $(srcdir)/config/i386/cygming-crtbegin.c
$(crt_compile) -fno-omit-frame-pointer -c $<
+crtbeginS.o: $(srcdir)/config/i386/cygming-crtbegin.c
+ $(crt_compile) -fno-omit-frame-pointer -c $< -DCRTSTUFFS_O
+
# We intentionally use a implementation-reserved init priority of 0,
# so allow the warning.
crtend.o: $(srcdir)/config/i386/cygming-crtend.c