Blame SOURCES/binutils-coverty-fixes.patch

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