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

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