Blame SOURCES/binutils-x86-lea-addressing.patch

3bc099
--- binutils.orig/bfd/elf32-i386.c	2018-05-02 15:59:44.716210095 +0100
3bc099
+++ binutils-2.27/bfd/elf32-i386.c	2018-05-02 16:02:12.714435574 +0100
3bc099
@@ -3982,7 +3982,9 @@ elf_i386_relocate_section (bfd *output_b
3bc099
 			      - gotplt->output_section->vma
3bc099
 			      - gotplt->output_offset);
3bc099
 
3bc099
-	      if ((*(contents + rel->r_offset - 1) & 0xc7) == 0x5)
3bc099
+	      if (rel->r_offset > 1
3bc099
+		  && (*(contents + rel->r_offset - 1) & 0xc7) == 0x5
3bc099
+		  && *(contents + rel->r_offset - 2) != 0x8d)
3bc099
 		{
3bc099
 		  if (bfd_link_pic (info))
3bc099
 		    goto disallow_got32;
3bc099
@@ -4252,7 +4254,9 @@ r_386_got32:
3bc099
 
3bc099
 	  relocation = (htab->elf.sgot->output_section->vma
3bc099
 			+ htab->elf.sgot->output_offset + off);
3bc099
-	  if ((*(contents + rel->r_offset - 1) & 0xc7) == 0x5)
3bc099
+	  if (rel->r_offset > 1
3bc099
+	      && (*(contents + rel->r_offset - 1) & 0xc7) == 0x5
3bc099
+	      && *(contents + rel->r_offset - 2) != 0x8d)
3bc099
 	    {
3bc099
 	      if (bfd_link_pic (info))
3bc099
 		{