Blame SOURCES/gcc34-pr26208-workaround.patch

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