<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-81) unstable; urgency=high

  * Version_2_6_13pre72
  * Fix to ppc64el for acl2 FTBFS bug

Gbp-Pq: Name Version_2_6_13pre73

configure
configure.in
h/arm-linux.h
h/elf32_arm_reloc.h
h/elf32_arm_reloc_special.h [new file with mode: 0644]

index f1e0ab092d397008027e0f155781b51d3c6c1c32..dff1b03767d2a34a225dfa6616de7fd3fdd8dd5c 100755 (executable)
--- a/configure
+++ b/configure
@@ -4181,7 +4181,7 @@ case $use in
                if test "$enable_debug" != "yes" ; then TO3FLAGS="-O" ; fi #FIXME needed asof gcc 4.8.1
                ;;
            arm*)
-               assert_arg_to_cflags -mlong-calls
+#              assert_arg_to_cflags -mlong-calls
                assert_arg_to_cflags -fdollars-in-identifiers
                assert_arg_to_cflags -g #?
                ;;
index 6794657b67b5be47283a63f0ee83225129a702ef..60ac5f1fa4db893576f22864f4b6d080f2db70d6 100644 (file)
@@ -388,7 +388,7 @@ case $use in
                if test "$enable_debug" != "yes" ; then TO3FLAGS="-O" ; fi #FIXME needed asof gcc 4.8.1
                ;;
            arm*)
-               assert_arg_to_cflags -mlong-calls
+#              assert_arg_to_cflags -mlong-calls
                assert_arg_to_cflags -fdollars-in-identifiers
                assert_arg_to_cflags -g #?
                ;;
index 3782c8f5fb15ea0842b325f609efa990a6f87e91..81d86ce7125cfdbde8e3ad8ff4d674f44dba0eb5 100755 (executable)
@@ -12,5 +12,6 @@
 #define SGC
 
 #define RELOC_H "elf32_arm_reloc.h"
+#define SPECIAL_RELOC_H "elf32_arm_reloc_special.h"
 
 #define NEED_STACK_CHK_GUARD
index fc07043c406212507eb97cf628f81789cb0f7ee2..6a504e4eda1345f4d036a31a131aa1a7932d97ba 100644 (file)
       break;
     case R_ARM_CALL:
     case R_ARM_JUMP24:
-      add_vals(where,MASK(24),((long)(s+a-p))>>2);
+      massert(!a);
+      {
+       long x=((long)(s-p))/4;
+       if (abs(x)&(~MASK(23))) {
+          got+=(sym->st_size-1)*tz;
+         memcpy(got,tramp,sizeof(tramp));
+          got[sizeof(tramp)/sizeof(*got)]=s;
+         x=((long)got-p)/4;
+       }
+       add_vals(where,MASK(24),x);
+      }
       break;
     case R_ARM_ABS32:
-      add_val(where,~0L,s+a);
+      add_vals(where,~0L,s+a);
       break;
     case R_ARM_V4BX:
-      add_val(where,~0L,s+a);
+      add_vals(where,~0L,s+a);
       break;
diff --git a/h/elf32_arm_reloc_special.h b/h/elf32_arm_reloc_special.h
new file mode 100644 (file)
index 0000000..0c3b692
--- /dev/null
@@ -0,0 +1,43 @@
+/* #define R_AARCH64_TRAMP 1 */
+static int tramp[]={0xe59fc000,  /*ldr r12, [pc]*/ /*FIXME?  Can this refer to an earlier address?*/
+                   0xe12fff1c}; /*br r12*/
+static ul tz=1+sizeof(tramp)/sizeof(ul);
+
+
+static int
+find_special_params(void *v,Shdr *sec1,Shdr *sece,const char *sn,
+                   const char *st1,Sym *ds1,Sym *dse,Sym *sym,Sym *syme) {
+
+  return 0;
+
+}
+
+static int
+label_got_symbols(void *v1,Shdr *sec1,Shdr *sece,Sym *sym1,Sym *syme,const char *st1,const char *sn,ul *gs) {
+
+  Rel *r;
+  Sym *sym;
+  Shdr *sec;
+  void *v,*ve;
+
+  for (sym=sym1;sym<syme;sym++)
+    sym->st_size=0;
+
+  for (*gs=0,sec=sec1;sec<sece;sec++)
+    if (sec->sh_type==SHT_REL)
+      for (v=v1+sec->sh_offset,ve=v+sec->sh_size,r=v;v<ve;v+=sec->sh_entsize,r=v)
+       if (ELF_R_TYPE(r->r_info)==R_ARM_CALL ||
+           ELF_R_TYPE(r->r_info)==R_ARM_JUMP24) {
+
+         sym=sym1+ELF_R_SYM(r->r_info);
+
+         if (!sym->st_size)
+           sym->st_size=++*gs;
+
+       }
+
+  (*gs)*=tz;
+
+  return 0;
+
+}