From 716953bd0e77d0bdc710efcbb85cfa67c5762914 Mon Sep 17 00:00:00 2001 From: Camm Maguire Date: Sun, 13 Nov 2022 12:55:14 +0000 Subject: [PATCH] Bug-Debian: https://bugs.debian.org/942312 Bug-Debian: https://bugs.debian.org/944651 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; (Closes: #942312). * Bug fix: "FTBFS on ppc64el", thanks to Ivo De Decker (Closes: #944651). Gbp-Pq: Name Version_2_6_13pre87 --- h/elf64_ppcle_reloc.h | 6 ++++++ h/elf64_ppcle_reloc_special.h | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/h/elf64_ppcle_reloc.h b/h/elf64_ppcle_reloc.h index 965f196..87c4508 100644 --- a/h/elf64_ppcle_reloc.h +++ b/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: diff --git a/h/elf64_ppcle_reloc_special.h b/h/elf64_ppcle_reloc_special.h index 26cb672..12c9f79 100644 --- a/h/elf64_ppcle_reloc_special.h +++ b/h/elf64_ppcle_reloc_special.h @@ -60,13 +60,12 @@ label_got_symbols(void *v1,Shdr *sec1,Shdr *sece,Sym *sym1,Sym *syme,const char Shdr *sec; Sym *sym; - massert(sec=get_section(".toc",sec1,sece,sn)); - - for (sym=sym1;symst_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; } } -- 2.30.2