1a405f
--- binutils.orig/gold/aarch64.cc	2017-01-18 16:05:12.747684566 +0000
1a405f
+++ binutils-2.27/gold/aarch64.cc	2017-01-18 16:05:23.128501011 +0000
1a405f
@@ -784,8 +784,14 @@ Stub_template_repertoire<big_endian>::St
1a405f
       0x14000000,    /* b <label> */
1a405f
     };
1a405f
 
1a405f
-  // ST_E_835769 has the same stub template as ST_E_843419.
1a405f
-  const static Insntype* ST_E_835769_INSNS = ST_E_843419_INSNS;
1a405f
+  // ST_E_835769 has the same stub template as ST_E_843419
1a405f
+  // but we reproduce the array here so that the sizeof
1a405f
+  // expressions in install_insn_template will work.
1a405f
+  const static Insntype ST_E_835769_INSNS[] =
1a405f
+    {
1a405f
+      0x00000000,    /* Placeholder for erratum insn. */
1a405f
+      0x14000000,    /* b <label> */
1a405f
+    };
1a405f
 
1a405f
 #define install_insn_template(T) \
1a405f
   const static Stub_template<big_endian> template_##T = {  \
1a405f
--- binutils.orig/gas/config/tc-i386.c	2017-01-18 16:05:12.533688350 +0000
1a405f
+++ binutils-2.27/gas/config/tc-i386.c	2017-01-18 16:11:29.828016979 +0000
1a405f
@@ -4120,13 +4120,13 @@ parse_operands (char *l, const char *mne
1a405f
 	{			/* Yes, we've read in another operand.  */
1a405f
 	  unsigned int operand_ok;
1a405f
 	  this_operand = i.operands++;
1a405f
-	  i.types[this_operand].bitfield.unspecified = 1;
1a405f
 	  if (i.operands > MAX_OPERANDS)
1a405f
 	    {
1a405f
 	      as_bad (_("spurious operands; (%d operands/instruction max)"),
1a405f
 		      MAX_OPERANDS);
1a405f
 	      return NULL;
1a405f
 	    }
1a405f
+	  i.types[this_operand].bitfield.unspecified = 1;
1a405f
 	  /* Now parse operand adding info to 'i' as we go along.  */
1a405f
 	  END_STRING_AND_SAVE (l);
1a405f
 
1a405f
diff -rup binutils.orig/ld/testplug2.c binutils-2.27/ld/testplug2.c
1a405f
--- binutils.orig/ld/testplug2.c	2017-01-18 16:05:12.777684035 +0000
1a405f
+++ binutils-2.27/ld/testplug2.c	2017-01-18 16:18:39.437420563 +0000
1a405f
@@ -242,10 +242,11 @@ parse_symdefstr (const char *str, struct
1a405f
     sym->version = NULL;
1a405f
   if (colon5 && colon5[1])
1a405f
     {
1a405f
-      sym->comdat_key = malloc (strlen (colon5 + 1) + 1);
1a405f
+      ++colon5;
1a405f
+      sym->comdat_key = malloc (strlen (colon5) + 1);
1a405f
       if (!sym->comdat_key)
1a405f
 	return LDPS_ERR;
1a405f
-      strcpy (sym->comdat_key, colon5 + 1);
1a405f
+      strcpy (sym->comdat_key, colon5);
1a405f
     }
1a405f
   else
1a405f
     sym->comdat_key = 0;
1a405f
diff -rup binutils.orig/ld/testplug3.c binutils-2.27/ld/testplug3.c
1a405f
--- binutils.orig/ld/testplug3.c	2017-01-18 16:05:12.777684035 +0000
1a405f
+++ binutils-2.27/ld/testplug3.c	2017-01-18 16:17:48.878314557 +0000
1a405f
@@ -241,10 +241,11 @@ parse_symdefstr (const char *str, struct
1a405f
     sym->version = NULL;
1a405f
   if (colon5 && colon5[1])
1a405f
     {
1a405f
-      sym->comdat_key = malloc (strlen (colon5 + 1) + 1);
1a405f
+      ++colon5;
1a405f
+      sym->comdat_key = malloc (strlen (colon5) + 1);
1a405f
       if (!sym->comdat_key)
1a405f
 	return LDPS_ERR;
1a405f
-      strcpy (sym->comdat_key, colon5 + 1);
1a405f
+      strcpy (sym->comdat_key, colon5);
1a405f
     }
1a405f
   else
1a405f
     sym->comdat_key = 0;
1a405f
diff -rup binutils.orig/ld/testplug4.c binutils-2.27/ld/testplug4.c
1a405f
--- binutils.orig/ld/testplug4.c	2017-01-18 16:05:12.777684035 +0000
1a405f
+++ binutils-2.27/ld/testplug4.c	2017-01-18 16:16:34.751625275 +0000
1a405f
@@ -242,10 +242,11 @@ parse_symdefstr (const char *str, struct
1a405f
     sym->version = NULL;
1a405f
   if (colon5 && colon5[1])
1a405f
     {
1a405f
-      sym->comdat_key = malloc (strlen (colon5 + 1) + 1);
1a405f
+      ++colon5;
1a405f
+      sym->comdat_key = malloc (strlen (colon5) + 1);
1a405f
       if (!sym->comdat_key)
1a405f
 	return LDPS_ERR;
1a405f
-      strcpy (sym->comdat_key, colon5 + 1);
1a405f
+      strcpy (sym->comdat_key, colon5);
1a405f
     }
1a405f
   else
1a405f
     sym->comdat_key = 0;
1a405f
diff -rup binutils.orig/ld/testplug.c binutils-2.27/ld/testplug.c
1a405f
--- binutils.orig/ld/testplug.c	2017-01-18 16:05:12.777684035 +0000
1a405f
+++ binutils-2.27/ld/testplug.c	2017-01-18 16:19:22.460659820 +0000
1a405f
@@ -238,10 +238,11 @@ parse_symdefstr (const char *str, struct
1a405f
     sym->version = NULL;
1a405f
   if (colon5 && colon5[1])
1a405f
     {
1a405f
-      sym->comdat_key = malloc (strlen (colon5 + 1) + 1);
1a405f
+      ++colon5;
1a405f
+      sym->comdat_key = malloc (strlen (colon5) + 1);
1a405f
       if (!sym->comdat_key)
1a405f
 	return LDPS_ERR;
1a405f
-      strcpy (sym->comdat_key, colon5 + 1);
1a405f
+      strcpy (sym->comdat_key, colon5);
1a405f
     }
1a405f
   else
1a405f
     sym->comdat_key = 0;