<short summary of the patch>
authorCamm Maguire <camm@debian.org>
Sun, 13 Nov 2022 12:55:14 +0000 (12:55 +0000)
committerCamm Maguire <camm@debian.org>
Sun, 13 Nov 2022 12:55:14 +0000 (12:55 +0000)
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.12-23) unstable; urgency=medium

  * Version_2_6_13pre29

Gbp-Pq: Name Version_2_6_13pre30

configure
configure.in
h/elf64_mips_reloc_special.h
o/main.c

index c92f0e3d7d6da545bba91bdac8a574c305e5d007..ca9431ea8294f8748c56d2a2e4d68c5a921f41fa 100755 (executable)
--- a/configure
+++ b/configure
@@ -4435,6 +4435,10 @@ case $use in
 #                      if test "$enable_debug" != "yes" ; then TO2FLAGS="-O" ; fi
                        ;;
                mips*)
+                       case $canonical in
+                       mips64*linux*)
+                               TLIBS="$TLIBS -Wl,-z -Wl,now";;
+                       esac
 #                      if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.6.2
                        ;;
                ia64*)
index 85d4dfbad02981d8f73ba655eb45fb733f29d84d..e9ce5e60f6ac0026dd4b940f256f9d39174cecfd 100644 (file)
@@ -640,6 +640,10 @@ case $use in
 #                      if test "$enable_debug" != "yes" ; then TO2FLAGS="-O" ; fi
                        ;;
                mips*)
+                       case $canonical in
+                       mips64*linux*)
+                               TLIBS="$TLIBS -Wl,-z -Wl,now";;
+                       esac
 #                      if test "$enable_debug" != "yes" ; then TO3FLAGS="-O0" ; fi #FIXME needed asof gcc 4.6.2
                        ;;
                ia64*)
index 980cabea3bf4ad32b1daba0a8220297454c4a8df..8ad20784c1992f21254075858eb526133d0fae3c 100644 (file)
@@ -6,18 +6,28 @@ static ul ggot,ggote; static Rela *hr;
 #define ELF_R_TYPE(a_) (((a_>>40)&0xff) ? ((a_>>40)&0xff) : ((a_>>56)&0xff)) 
 #define ELF_R_FTYPE(a_) ((a_>>56)&0xff)
 
+typedef struct {
+  ul entry,gotoff;
+  unsigned int ld_gotoff,lw,jr,lwcan;
+} call_16_tramp;
+
 static int
 write_stub(ul s,ul *got,ul *gote) {
 
-  int *goti;
+  static call_16_tramp t1={0,0,
+                          (0x37<<26)|(0x1c<<21)|(0x19<<16), /*ld t9,(0)gp*/
+                          (0x37<<26)|(0x19<<21)|(0x19<<16), /*ld t9,(0)t9*/
+                          0x03200008,                       /*jr t9*/
+                          0                                 /*nop*/
+  };
+  call_16_tramp *t=(void *)gote;
+
+  *t=t1;
+  *got=can_gp;
 
-  *gote=(ul)(goti=(void *)(gote+2));
-  *++gote=s;
-  s=((void *)gote-(void *)got);
-  *goti++=(0x37<<26)|(0x1c<<21)|(0x19<<16)|s;
-  *goti++=(0x37<<26)|(0x19<<21)|(0x19<<16)|0;
-  *goti++=0x03200008;
-  *goti++=0x00200825;
+  t->entry=(ul)(gote+2);
+  t->gotoff=s;
+  t->ld_gotoff|=((void *)(gote+1)-(void *)got);
 
   return 0;
 
@@ -31,7 +41,7 @@ make_got_room_for_stub(Shdr *sec1,Shdr *sece,Sym *sym,const char *st1,ul *gs) {
   if ((ssec>=sece || !ALLOC_SEC(ssec)) &&
       (a=find_sym_ptable(st1+sym->st_name)) &&
       a->address>=ggot && a->address<ggote)
-    (*gs)+=3;
+    (*gs)+=sizeof(call_16_tramp)/sizeof(ul)-1;
 
   return 0;
 
index 4fb4a933297d6a50db8b2d072d3eb7be2174f77e..782ce45830b5134a152f6b36c24d0fce04d12232 100755 (executable)
--- a/o/main.c
+++ b/o/main.c
@@ -212,7 +212,7 @@ get_phys_pages_no_malloc(char freep) {
 
   struct sysinfo s;
   sysinfo(&s);
-  return (freep ? s.freeram : s.totalram)>>PAGEWIDTH;
+  return ((freep ? s.freeram : s.totalram)>>PAGEWIDTH)*s.mem_unit;
   
 }