Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 gcl (2.6.7+dfsga-25) unstable; urgency=high
 .
   * alpha, mips, 68k
Author: Camm Maguire <camm@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- gcl-2.6.7+dfsga.orig/configure
+++ gcl-2.6.7+dfsga/configure
@@ -4221,7 +4221,7 @@ done
 # Work around system/gprof mips/hppa hang
 case $use in
   sh4*)  enable_gprof="no";;
-  mips*) enable_gprof="no";;
+#  mips*) enable_gprof="no";;
   hppa*) enable_gprof="no";;
   arm*)  enable_gprof="no";;#FIXME mcount compiled as a 24/22 bit reloc even with -mlong-calls, marginally accessible
   *gnu)  enable_gprof="no";;
@@ -4296,7 +4296,7 @@ case $use in
 #			if test "$enable_debug" != "yes" ; then TO2FLAGS="-O" ; fi
 			;;
 		mips*)
-			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O" ; fi #FIXME needed asof gcc 4.6.2
+			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.6.2
 			;;
 		ia64*)
 			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O" ; fi #FIXME needed asof gcc 4.6.2
--- gcl-2.6.7+dfsga.orig/configure.in
+++ gcl-2.6.7+dfsga/configure.in
@@ -512,7 +512,7 @@ AC_CHECK_PROGS(AWK,[gawk nawk awk])
 # Work around system/gprof mips/hppa hang
 case $use in
   sh4*)  enable_gprof="no";;
-  mips*) enable_gprof="no";;
+#  mips*) enable_gprof="no";;
   hppa*) enable_gprof="no";;
   arm*)  enable_gprof="no";;#FIXME mcount compiled as a 24/22 bit reloc even with -mlong-calls, marginally accessible
   *gnu)  enable_gprof="no";;
@@ -577,7 +577,7 @@ case $use in
 #			if test "$enable_debug" != "yes" ; then TO2FLAGS="-O" ; fi
 			;;
 		mips*)
-			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O" ; fi #FIXME needed asof gcc 4.6.2
+			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.6.2
 			;;
 		ia64*)
 			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O" ; fi #FIXME needed asof gcc 4.6.2
--- gcl-2.6.7+dfsga.orig/h/elf64_alpha_reloc.h
+++ gcl-2.6.7+dfsga/h/elf64_alpha_reloc.h
@@ -22,8 +22,9 @@
       store_val(where,MASK(32),s+a);
       break;
     case R_ALPHA_LITERAL:
-      s+=a&MASK(32);
-      gote=got+(a>>32)-1;
+      s+=a;
+      if (a || !(sym->st_other&0x1)) {gotp+=1+(sym->st_other>>1);sym->st_other|=1;}
+      gote=got+(a ? gotp : sym->st_size)-1;
       massert(s); 
       if (s>=ggot1 && s<ggote) {
         massert(!write_stub(s,got,gote));
--- gcl-2.6.7+dfsga.orig/h/m68k-linux.h
+++ gcl-2.6.7+dfsga/h/m68k-linux.h
@@ -54,7 +54,7 @@
 	(char *)ea; })
 #endif
 
-#define NULL_OR_ON_C_STACK(x) ( x == 0 || (((unsigned int) x) >= 0xe0000000 )) 
+/* #define NULL_OR_ON_C_STACK(x) ( x == 0 || (((unsigned int) x) >= 0xe0000000 ))  */
 
 #define ADDITIONAL_FEATURES \
 		     ADD_FEATURE("BSD386"); \
--- gcl-2.6.7+dfsga.orig/h/elf64_alpha_reloc_special.h
+++ gcl-2.6.7+dfsga/h/elf64_alpha_reloc_special.h
@@ -1,4 +1,4 @@
-static ul ggot1,ggote;
+static ul ggot1,ggote,gotp;
 
 static int
 write_stub(ul s,ul *got,ul *gote) {
@@ -65,10 +65,11 @@ label_got_symbols(void *v1,Shdr *sec1,Sh
   Sym *sym;
   Shdr *sec;
   void *v,*ve;
-  ul q=0,b;
+  ul q=0;
 
+  gotp=0;
   for (sym=sym1;sym<syme;sym++)
-    sym->st_size=0;
+    sym->st_other=sym->st_size=0;
 
   for (*gs=0,sec=sec1;sec<sece;sec++)
     if (sec->sh_type==SHT_RELA)
@@ -79,15 +80,11 @@ label_got_symbols(void *v1,Shdr *sec1,Sh
 	    
 	  if (!sym->st_size || r->r_addend) { 
 	    q=++*gs; 
-	    if (!r->r_addend) sym->st_size=q; 
+	    if (!sym->st_size) sym->st_size=q;
 	    massert(!make_got_room_for_stub(sec1,sece,sym,st1,gs));
+	    sym->st_other=(*gs-q)<<1;
 	  }
 
-	  b=sizeof(r->r_addend)*4; 
-	  massert(!(r->r_addend>>b)); 
-	  q=r->r_addend ? q : sym->st_size; 
-	  r->r_addend|=(q<<=b); 
-
 	}
   
   return 0;
