<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_13pre72

h/elf64_ppcle_reloc_special.h

index 93aad64b82b80c0ac003608a12d6bf6e595c1622..889d5d698f0628dc6ff814f313e2dfccdc3ac971 100644 (file)
@@ -1,12 +1,12 @@
 static Sym *toc;
 
-/* static int tramp[]={0,0, */
-/*                 (((0x3a<<10)|(0x9<<5)|0xc)<<16)|0xfff8,/\*ld      r9,-8(r12)*\/ */
-/*                 ((0x3a<<10)|(0x9<<5)|0x9)<<16,         /\*ld      r9,0(r9)*\/ */
-/*                 0x7d2c4b78,                            /\*mr      r12,r9 *\/ */
-/*                 0x7d8903a6,                            /\*mtctr   r12*\/ */
-/*                 0x4e800420                             /\*bctrl*\/ */
-/* }; */
+static int tramp[]={0,0,
+                   (((0x3a<<10)|(0x9<<5)|0xc)<<16)|0xfff8,/*ld      r9,-8(r12)*/
+                   ((0x3a<<10)|(0x9<<5)|0x9)<<16,         /*ld      r9,0(r9)*/
+                   0x7d2c4b78,                            /*mr      r12,r9 */
+                   0x7d8903a6,                            /*mtctr   r12*/
+                   0x4e800420                             /*bctrl*/
+};
 
 static int
 find_special_params(void *v,Shdr *sec1,Shdr *sece,const char *sn,
@@ -15,41 +15,29 @@ find_special_params(void *v,Shdr *sec1,Shdr *sece,const char *sn,
   Shdr *sec;
   Rela *r;
   void *ve;
+  ul *u,j;
 
   massert((sec=get_section(".rela.dyn",sec1,sece,sn)));
 
   v+=sec->sh_offset;
   ve=v+sec->sh_size;
 
-  for (r=v;v<ve;v+=sec->sh_entsize,r=v) 
+  for (j=0,r=v;v<ve;v+=sec->sh_entsize,r=v)
     if (ELF_R_TYPE(r->r_info) && !ds1[ELF_R_SYM(r->r_info)].st_value)
-       ds1[ELF_R_SYM(r->r_info)].st_value=*(ul *)r->r_offset;
+      j++;
 
-  return 0;
-
-
-  /* massert((sec=get_section(".rel.dyn",sec1,sece,sn))|| */
-  /*     (sec=get_section(".rela.dyn",sec1,sece,sn))); */
-
-  /* v+=sec->sh_offset; */
-  /* ve=v+sec->sh_size; */
+  massert(u=malloc(j*sizeof(tramp)));
 
-  /* for (j=0,r=v;v<ve;v+=sec->sh_entsize,r=v)  */
-  /*   if (ELF_R_TYPE(r->r_info) && !ds1[ELF_R_SYM(r->r_info)].st_value) */
-  /*     j++; */
-
-  /* massert(u=malloc(j*sizeof(tramp))); */
-
-  /* v=ve-sec->sh_size; */
-  /* for (r=v;v<ve;v+=sec->sh_entsize,r=v)  */
-  /*   if (ELF_R_TYPE(r->r_info) && !ds1[ELF_R_SYM(r->r_info)].st_value) { */
-  /*     memcpy(u,tramp,sizeof(tramp)); */
-  /*     *u++=r->r_offset; */
-  /*     ds1[ELF_R_SYM(r->r_info)].st_value=(ul)u; */
-  /*     u=((void *)(u-1)+sizeof(tramp)); */
-  /*   } */
+  v=ve-sec->sh_size;
+  for (r=v;v<ve;v+=sec->sh_entsize,r=v)
+    if (ELF_R_TYPE(r->r_info) && !ds1[ELF_R_SYM(r->r_info)].st_value) {
+      memcpy(u,tramp,sizeof(tramp));
+      *u++=r->r_offset;
+      ds1[ELF_R_SYM(r->r_info)].st_value=(ul)u;
+      u=((void *)(u-1)+sizeof(tramp));
+    }
 
-  /* return 0; */
+  return 0;
 
 }