385abae
Description: <short summary of the patch>
385abae
 TODO: Put a short summary on the line above and replace this paragraph
385abae
 with a longer explanation of this change. Complete the meta-information
385abae
 with other relevant fields (see below for details). To make it easier, the
385abae
 information below has been extracted from the changelog. Adjust it or drop
385abae
 it.
385abae
 .
385abae
 gcl (2.6.12-23) unstable; urgency=medium
385abae
 .
385abae
   * Version_2_6_13pre29
385abae
Author: Camm Maguire <camm@debian.org>
385abae
385abae
---
385abae
The information above should follow the Patch Tagging Guidelines, please
385abae
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
385abae
are templates for supplementary fields that you might want to add:
385abae
385abae
Origin: <vendor|upstream|other>, <url of original patch>
385abae
Bug: <url in upstream bugtracker>
385abae
Bug-Debian: https://bugs.debian.org/<bugnumber>
385abae
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
385abae
Forwarded: <no|not-needed|url proving that it has been forwarded>
385abae
Reviewed-By: <name and email of someone who approved the patch>
385abae
Last-Update: <YYYY-MM-DD>
385abae
385abae
--- gcl-2.6.12.orig/configure
385abae
+++ gcl-2.6.12/configure
385abae
@@ -4435,6 +4435,10 @@ case $use in
385abae
 #			if test "$enable_debug" != "yes" ; then TO2FLAGS="-O" ; fi
385abae
 			;;
385abae
 		mips*)
385abae
+			case $canonical in
385abae
+			mips64*linux*)
385abae
+				TLIBS="$TLIBS -Wl,-z -Wl,now";;
385abae
+			esac
385abae
 #			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.6.2
385abae
 			;;
385abae
 		ia64*)
385abae
--- gcl-2.6.12.orig/configure.in
385abae
+++ gcl-2.6.12/configure.in
385abae
@@ -640,6 +640,10 @@ case $use in
385abae
 #			if test "$enable_debug" != "yes" ; then TO2FLAGS="-O" ; fi
385abae
 			;;
385abae
 		mips*)
385abae
+			case $canonical in
385abae
+			mips64*linux*)
385abae
+				TLIBS="$TLIBS -Wl,-z -Wl,now";;
385abae
+			esac
385abae
 #			if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.6.2
385abae
 			;;
385abae
 		ia64*)
385abae
--- gcl-2.6.12.orig/h/elf64_mips_reloc_special.h
385abae
+++ gcl-2.6.12/h/elf64_mips_reloc_special.h
385abae
@@ -6,18 +6,28 @@ static ul ggot,ggote; static Rela *hr;
385abae
 #define ELF_R_TYPE(a_) (((a_>>40)&0xff) ? ((a_>>40)&0xff) : ((a_>>56)&0xff)) 
385abae
 #define ELF_R_FTYPE(a_) ((a_>>56)&0xff)
385abae
 
385abae
+typedef struct {
385abae
+  ul entry,gotoff;
385abae
+  unsigned int ld_gotoff,lw,jr,lwcan;
385abae
+} call_16_tramp;
385abae
+
385abae
 static int
385abae
 write_stub(ul s,ul *got,ul *gote) {
385abae
 
385abae
-  int *goti;
385abae
-
385abae
-  *gote=(ul)(goti=(void *)(gote+2));
385abae
-  *++gote=s;
385abae
-  s=((void *)gote-(void *)got);
385abae
-  *goti++=(0x37<<26)|(0x1c<<21)|(0x19<<16)|s;
385abae
-  *goti++=(0x37<<26)|(0x19<<21)|(0x19<<16)|0;
385abae
-  *goti++=0x03200008;
385abae
-  *goti++=0x00200825;
385abae
+  static call_16_tramp t1={0,0,
385abae
+			   (0x37<<26)|(0x1c<<21)|(0x19<<16), /*ld t9,(0)gp*/
385abae
+			   (0x37<<26)|(0x19<<21)|(0x19<<16), /*ld t9,(0)t9*/
385abae
+			   0x03200008,                       /*jr t9*/
385abae
+			   0                                 /*nop*/
385abae
+  };
385abae
+  call_16_tramp *t=(void *)gote;
385abae
+
385abae
+  *t=t1;
385abae
+  *got=can_gp;
385abae
+
385abae
+  t->entry=(ul)(gote+2);
385abae
+  t->gotoff=s;
385abae
+  t->ld_gotoff|=((void *)(gote+1)-(void *)got);
385abae
 
385abae
   return 0;
385abae
 
385abae
@@ -31,7 +41,7 @@ make_got_room_for_stub(Shdr *sec1,Shdr *
385abae
   if ((ssec>=sece || !ALLOC_SEC(ssec)) &&
385abae
       (a=find_sym_ptable(st1+sym->st_name)) &&
385abae
       a->address>=ggot && a->address
385abae
-    (*gs)+=3;
385abae
+    (*gs)+=sizeof(call_16_tramp)/sizeof(ul)-1;
385abae
 
385abae
   return 0;
385abae
 
385abae
--- gcl-2.6.12.orig/o/main.c
385abae
+++ gcl-2.6.12/o/main.c
385abae
@@ -212,7 +212,7 @@ get_phys_pages_no_malloc(char freep) {
385abae
 
385abae
   struct sysinfo s;
385abae
   sysinfo(&s);
385abae
-  return (freep ? s.freeram : s.totalram)>>PAGEWIDTH;
385abae
+  return ((freep ? s.freeram : s.totalram)>>PAGEWIDTH)*s.mem_unit;
385abae
   
385abae
 }
385abae