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-95) unstable; urgency=high
 .
   * Version_2_6_13pre90
   * build under GCL_MEM_MULTIPLE=0.1
   * Bug fix: "FTBFS: Unrecoverable error: Segmentation violation..",
     thanks to Lucas Nussbaum (Closes: #952334).
Author: Camm Maguire <camm@debian.org>
Bug-Debian: https://bugs.debian.org/952334

---
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: 2020-08-23

--- gcl-2.6.12.orig/h/elf32_armhf_reloc_special.h
+++ gcl-2.6.12/h/elf32_armhf_reloc_special.h
@@ -6,13 +6,15 @@ static ul tz=sizeof(tramp)/sizeof(ul);
 static ul *
 next_plt_entry(ul *p,ul *pe) {
 
-  ul l0=0xe5bef000,/*ldr pc,[ip,#]*/
-     l1=0xe5bcf000;/*ldr pc,[lr,#]*/
+   /* 4778      	bx	pc */ /*optional*/
+   /* e7fd      	b.n	20dd0 <__fprintf_chk@plt> */ /*optional*/
+   /*      above when stripped becomes undefined instruction*/
+   /* e28fc601 	add	ip, pc, #1048576	; 0x100000 */
+   /* e28ccab0 	add	ip, ip, #176, 20	; 0xb0000 */
+   /* e5bcf914 	ldr	pc, [ip, #2324]!	; 0x914 */
 
-  for (;p<pe && (*p&l0)!=l0 && (*p&l1)!=l1;p++);
-  if ((*p&l0)==l0) p++;
-
-  return p+1;
+  for (p=p+2;p<pe && ((*p)>>20)!=0xe28;p++);
+  return p;
 
 }