Blob Blame History Raw
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.12-89) unstable; urgency=medium
 .
   * Bug fix: "gcl - FTBFS on ppc64el - invalid relocation type 31", thanks
     to thierry.fauck@fr.ibm.com</a>; (Closes: #942312).
   * Bug fix: "FTBFS on ppc64el", thanks to Ivo De Decker (Closes:
     #944651).
Author: Camm Maguire <camm@debian.org>
Bug-Debian: https://bugs.debian.org/942312
Bug-Debian: https://bugs.debian.org/944651

---
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: https://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: 2019-12-08

--- gcl-2.6.12.orig/h/elf64_ppcle_reloc.h
+++ gcl-2.6.12/h/elf64_ppcle_reloc.h
@@ -10,32 +10,38 @@
     case R_PPC64_PLT16_HA:
       gote=got+sym->st_size-1;
       *gote=s+a;
+      massert(toc);
       store_val(where,MASK(16),ha((ul)gote-toc->st_value));
       break;
     case R_PPC64_PLT16_LO_DS:
       gote=got+sym->st_size-1;
       *gote=s+a;
+      massert(toc);
       store_val(where,MASK(16),lo((ul)gote-toc->st_value));/*>>2*/
       break;
     case R_PPC64_PLTSEQ:
     case R_PPC64_PLTCALL:
       break;
     case R_PPC64_TOC16_HA: 
+      massert(toc);
       store_val(where,MASK(16),ha(s+a-toc->st_value));
       break;
     case R_PPC64_TOC16_LO_DS: 
+      massert(toc);
       store_val(where,MASK(16),lo(s+a-toc->st_value));/*>>2*/
       break;
     case R_PPC64_REL16_LO:
       store_val(where,MASK(16),lo(s+a-p));
       break;
     case R_PPC64_TOC16_LO:
+      massert(toc);
       store_val(where,MASK(16),lo(s+a-toc->st_value));
       break;
     case R_PPC64_ADDR64:
       store_val(where,~0L,(s+a));
       break;
     case R_PPC64_TOC:
+      massert(toc);
       store_val(where,~0L,toc->st_value);
       break;
     case R_PPC64_REL32:
--- gcl-2.6.12.orig/h/elf64_ppcle_reloc_special.h
+++ gcl-2.6.12/h/elf64_ppcle_reloc_special.h
@@ -60,13 +60,12 @@ label_got_symbols(void *v1,Shdr *sec1,Sh
   Shdr *sec;
   Sym *sym;
   
-  massert(sec=get_section(".toc",sec1,sece,sn));
-
-  for (sym=sym1;sym<syme;sym++) {
+  for (toc=NULL,sym=sym1;sym<syme;sym++) {
     const char *s=st1+sym->st_name;
     if (!strcmp(s,".TOC.") || !strcmp(s,".toc.")) {
       toc=sym;
       toc->st_info=ELF_ST_INFO(STB_LOCAL,ELF_ST_TYPE(sym->st_info));
+      massert((sec=get_section(".bss",sec1,sece,sn)));
       toc->st_shndx=sec-sec1;
     }
   }