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

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