summaryrefslogtreecommitdiffstats
path: root/gcc48-libgcc-deregister.patch
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowitz@users.sourceforge.net>2014-07-25 11:29:28 -0500
committerYaakov Selkowitz <yselkowitz@users.sourceforge.net>2014-07-25 11:29:28 -0500
commitcd116f01a90082574f078c06fb2d94ebbaa24711 (patch)
treeaace1627a97d5eb8c9ae72f75714c43a77219db2 /gcc48-libgcc-deregister.patch
parent5d80c3587d8536202933a341e1039b583bb71554 (diff)
downloadcygwin-gcc-cd116f01a90082574f078c06fb2d94ebbaa24711.tar.gz
cygwin-gcc-cd116f01a90082574f078c06fb2d94ebbaa24711.tar.xz
cygwin-gcc-cd116f01a90082574f078c06fb2d94ebbaa24711.zip
Add patch to fix libgcc deregistration on x86
Diffstat (limited to 'gcc48-libgcc-deregister.patch')
-rw-r--r--gcc48-libgcc-deregister.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/gcc48-libgcc-deregister.patch b/gcc48-libgcc-deregister.patch
new file mode 100644
index 0000000..23b2958
--- /dev/null
+++ b/gcc48-libgcc-deregister.patch
@@ -0,0 +1,61 @@
+Index: libgcc/config/i386/cygming-crtbegin.c
+===================================================================
+--- libgcc/config/i386/cygming-crtbegin.c (revision 212546)
++++ libgcc/config/i386/cygming-crtbegin.c (working copy)
+@@ -99,12 +99,13 @@ static EH_FRAME_SECTION_CONST char __EH_
+ = { };
+
+ static struct object obj;
+
+ /* Handle of libgcc's DLL reference. */
+ HANDLE hmod_libgcc;
++static void * (*deregister_frame_fn) (const void *) = NULL;
+ #endif
+
+ #if TARGET_USE_JCR_SECTION
+ static void *__JCR_LIST__[]
+ __attribute__ ((used, section(JCR_SECTION_NAME), aligned(4)))
+ = { };
+@@ -130,15 +131,20 @@ __gcc_register_frame (void)
+ if (h)
+ {
+ /* Increasing the load-count of LIBGCC_SONAME DLL. */
+ hmod_libgcc = LoadLibrary (LIBGCC_SONAME);
+ register_frame_fn = (void (*) (const void *, struct object *))
+ GetProcAddress (h, "__register_frame_info");
++ deregister_frame_fn = (void* (*) (const void *))
++ GetProcAddress (h, "__deregister_frame_info");
++ }
++ else
++ {
++ register_frame_fn = __register_frame_info;
++ deregister_frame_fn = __deregister_frame_info;
+ }
+- else
+- register_frame_fn = __register_frame_info;
+ if (register_frame_fn)
+ register_frame_fn (__EH_FRAME_BEGIN__, &obj);
+ #endif
+
+ #if TARGET_USE_JCR_SECTION
+ if (__JCR_LIST__[0])
+@@ -158,19 +164,12 @@ __gcc_register_frame (void)
+ }
+
+ void
+ __gcc_deregister_frame (void)
+ {
+ #if DWARF2_UNWIND_INFO
+- void * (*deregister_frame_fn) (const void *);
+- HANDLE h = GetModuleHandle (LIBGCC_SONAME);
+- if (h)
+- deregister_frame_fn = (void* (*) (const void *))
+- GetProcAddress (h, "__deregister_frame_info");
+- else
+- deregister_frame_fn = __deregister_frame_info;
+ if (deregister_frame_fn)
+ deregister_frame_fn (__EH_FRAME_BEGIN__);
+ if (hmod_libgcc)
+ FreeLibrary (hmod_libgcc);
+ #endif
+ }