Blame SOURCES/gcc34-pr26208-workaround.patch

6693b3
--- gcc/unwind-dw2.c.jj	2006-05-22 13:39:48.000000000 -0400
6693b3
+++ gcc/unwind-dw2.c	2006-05-22 13:48:20.000000000 -0400
6693b3
@@ -40,6 +40,7 @@
6693b3
 #include "unwind-pe.h"
6693b3
 #include "unwind-dw2-fde.h"
6693b3
 #include "gthr.h"
6693b3
+#include <endian.h>
6693b3
 
6693b3
 
6693b3
 #ifndef __USING_SJLJ_EXCEPTIONS__
6693b3
@@ -81,8 +82,15 @@ struct _Unwind_Context
6693b3
   void *ra;
6693b3
   void *lsda;
6693b3
   struct dwarf_eh_bases bases;
6693b3
-  _Unwind_Word args_size;
6693b3
-  char signal_frame;
6693b3
+#if __BYTE_ORDER == __BIG_ENDIAN
6693b3
+  _Unwind_Word signal_frame : 1;
6693b3
+  _Unwind_Word args_size : sizeof (_Unwind_Word) * 8 - 1;
6693b3
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
6693b3
+  _Unwind_Word args_size : sizeof (_Unwind_Word) * 8 - 1;
6693b3
+  _Unwind_Word signal_frame : 1;
6693b3
+#else
6693b3
+#error Unknown endianity
6693b3
+#endif
6693b3
 };
6693b3
 
6693b3
 /* Byte size of every register managed by these routines.  */
6693b3
@@ -1003,7 +1011,13 @@ execute_cfa_program (const unsigned char
6693b3
 	  break;
6693b3
 
6693b3
 	case DW_CFA_GNU_args_size:
6693b3
-	  insn_ptr = read_uleb128 (insn_ptr, &context->args_size);
6693b3
+	  {
6693b3
+	    _Unwind_Word args_size;
6693b3
+	    insn_ptr = read_uleb128 (insn_ptr, &args_size);
6693b3
+	    context->args_size = args_size;
6693b3
+	    if (context->args_size != args_size)
6693b3
+	      abort ();
6693b3
+	  }
6693b3
 	  break;
6693b3
 
6693b3
 	case DW_CFA_GNU_negative_offset_extended:
6693b3
--- libjava/exception.cc.jj	2006-05-22 13:39:48.000000000 -0400
6693b3
+++ libjava/exception.cc	2006-05-22 14:48:30.000000000 -0400
6693b3
@@ -31,6 +31,153 @@ namespace std
6693b3
 }
6693b3
 #include "unwind.h"
6693b3
 
6693b3
+#if defined PIC && !defined __ia64__
6693b3
+
6693b3
+#include <dlfcn.h>
6693b3
+
6693b3
+extern "C" {
6693b3
+
6693b3
+static void *libgcc_s_handle;
6693b3
+
6693b3
+_Unwind_Reason_Code __attribute__((visibility ("hidden")))
6693b3
+_Unwind_RaiseException (struct _Unwind_Exception *exc)
6693b3
+{
6693b3
+  static _Unwind_Reason_Code (*RaiseException) (struct _Unwind_Exception *);
6693b3
+
6693b3
+  if (RaiseException == NULL)
6693b3
+    {
6693b3
+      if (libgcc_s_handle == NULL)
6693b3
+	libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
6693b3
+      RaiseException = (__typeof (RaiseException))
6693b3
+	dlsym (libgcc_s_handle, "_Unwind_RaiseException");
6693b3
+    }
6693b3
+  return RaiseException (exc);
6693b3
+}
6693b3
+
6693b3
+void __attribute__((visibility ("hidden")))
6693b3
+_Unwind_Resume (struct _Unwind_Exception *exc)
6693b3
+{
6693b3
+  static void (*Resume) (struct _Unwind_Exception *);
6693b3
+
6693b3
+  if (Resume == NULL)
6693b3
+    {
6693b3
+      if (libgcc_s_handle == NULL)
6693b3
+	libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
6693b3
+      Resume = (__typeof (Resume))
6693b3
+	dlsym (libgcc_s_handle, "_Unwind_Resume");
6693b3
+    }
6693b3
+  Resume (exc);
6693b3
+}
6693b3
+
6693b3
+__attribute__((visibility ("hidden"))) void * 
6693b3
+_Unwind_GetLanguageSpecificData (struct _Unwind_Context *ctx)
6693b3
+{
6693b3
+  static void * (*GetLanguageSpecificData) (struct _Unwind_Context *);
6693b3
+
6693b3
+  if (GetLanguageSpecificData == NULL)
6693b3
+    {
6693b3
+      if (libgcc_s_handle == NULL)
6693b3
+	libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
6693b3
+      GetLanguageSpecificData = (__typeof (GetLanguageSpecificData))
6693b3
+	dlsym (libgcc_s_handle, "_Unwind_GetLanguageSpecificData");
6693b3
+    }
6693b3
+  return GetLanguageSpecificData (ctx);
6693b3
+}
6693b3
+
6693b3
+_Unwind_Ptr __attribute__((visibility ("hidden")))
6693b3
+_Unwind_GetRegionStart (struct _Unwind_Context *ctx)
6693b3
+{
6693b3
+  static _Unwind_Ptr (*GetRegionStart) (struct _Unwind_Context *);
6693b3
+
6693b3
+  if (GetRegionStart == NULL)
6693b3
+    {
6693b3
+      if (libgcc_s_handle == NULL)
6693b3
+	libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
6693b3
+      GetRegionStart = (__typeof (GetRegionStart))
6693b3
+	dlsym (libgcc_s_handle, "_Unwind_GetRegionStart");
6693b3
+    }
6693b3
+  return GetRegionStart (ctx);
6693b3
+}
6693b3
+
6693b3
+_Unwind_Ptr __attribute__((visibility ("hidden")))
6693b3
+_Unwind_GetDataRelBase (struct _Unwind_Context *ctx)
6693b3
+{
6693b3
+  static _Unwind_Ptr (*GetDataRelBase) (struct _Unwind_Context *);
6693b3
+
6693b3
+  if (GetDataRelBase == NULL)
6693b3
+    {
6693b3
+      if (libgcc_s_handle == NULL)
6693b3
+	libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
6693b3
+      GetDataRelBase = (__typeof (GetDataRelBase))
6693b3
+	dlsym (libgcc_s_handle, "_Unwind_GetDataRelBase");
6693b3
+    }
6693b3
+  return GetDataRelBase (ctx);
6693b3
+}
6693b3
+
6693b3
+_Unwind_Ptr __attribute__((visibility ("hidden")))
6693b3
+_Unwind_GetTextRelBase (struct _Unwind_Context *ctx)
6693b3
+{
6693b3
+  static _Unwind_Ptr (*GetTextRelBase) (struct _Unwind_Context *);
6693b3
+
6693b3
+  if (GetTextRelBase == NULL)
6693b3
+    {
6693b3
+      if (libgcc_s_handle == NULL)
6693b3
+	libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
6693b3
+      GetTextRelBase = (__typeof (GetTextRelBase))
6693b3
+	dlsym (libgcc_s_handle, "_Unwind_GetTextRelBase");
6693b3
+    }
6693b3
+  return GetTextRelBase (ctx);
6693b3
+}
6693b3
+
6693b3
+_Unwind_Ptr __attribute__((visibility ("hidden")))
6693b3
+_Unwind_GetIPInfo (struct _Unwind_Context *ctx, int *ip)
6693b3
+{
6693b3
+  static _Unwind_Ptr (*GetIPInfo) (struct _Unwind_Context *, int *ip);
6693b3
+
6693b3
+  if (GetIPInfo == NULL)
6693b3
+    {
6693b3
+      if (libgcc_s_handle == NULL)
6693b3
+	libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
6693b3
+      GetIPInfo = (__typeof (GetIPInfo))
6693b3
+	dlsym (libgcc_s_handle, "_Unwind_GetIPInfo");
6693b3
+    }
6693b3
+  return GetIPInfo (ctx, ip);
6693b3
+}
6693b3
+
6693b3
+void __attribute__((visibility ("hidden")))
6693b3
+_Unwind_SetIP (struct _Unwind_Context *ctx, _Unwind_Ptr ip)
6693b3
+{
6693b3
+  static void (*SetIP) (struct _Unwind_Context *, _Unwind_Ptr ip);
6693b3
+
6693b3
+  if (SetIP == NULL)
6693b3
+    {
6693b3
+      if (libgcc_s_handle == NULL)
6693b3
+	libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
6693b3
+      SetIP = (__typeof (SetIP))
6693b3
+	dlsym (libgcc_s_handle, "_Unwind_SetIP");
6693b3
+    }
6693b3
+  SetIP (ctx, ip);
6693b3
+}
6693b3
+
6693b3
+void __attribute__((visibility ("hidden")))
6693b3
+_Unwind_SetGR (struct _Unwind_Context *ctx, int num, _Unwind_Ptr gr)
6693b3
+{
6693b3
+  static void (*SetGR) (struct _Unwind_Context *, int num, _Unwind_Ptr gr);
6693b3
+
6693b3
+  if (SetGR == NULL)
6693b3
+    {
6693b3
+      if (libgcc_s_handle == NULL)
6693b3
+	libgcc_s_handle = dlopen ("libgcc_s.so.1", RTLD_LAZY);
6693b3
+      SetGR = (__typeof (SetGR))
6693b3
+	dlsym (libgcc_s_handle, "_Unwind_SetGR");
6693b3
+    }
6693b3
+  SetGR (ctx, num, gr);
6693b3
+}
6693b3
+
6693b3
+}
6693b3
+
6693b3
+#endif
6693b3
+
6693b3
 struct alignment_test_struct
6693b3
 {
6693b3
   char space;