Blame SOURCES/binutils-gcc-10-fixes.patch

3dad3f
diff -rup binutils.orig/gold/gdb-index.cc binutils-2.34.0/gold/gdb-index.cc
3dad3f
--- binutils.orig/gold/gdb-index.cc	2020-07-24 09:12:29.241306445 +0100
3dad3f
+++ binutils-2.34.0/gold/gdb-index.cc	2020-07-24 09:15:48.332095898 +0100
3dad3f
@@ -817,7 +817,7 @@ Gdb_index_info_reader::get_qualified_nam
3dad3f
 void
3dad3f
 Gdb_index_info_reader::record_cu_ranges(Dwarf_die* die)
3dad3f
 {
3dad3f
-  unsigned int shndx;
3dad3f
+  unsigned int shndx = 0;
3dad3f
   unsigned int shndx2;
3dad3f
 
3dad3f
   off_t ranges_offset = die->ref_attribute(elfcpp::DW_AT_ranges, &shndx);
3dad3f
diff -rup binutils.orig/gold/layout.cc binutils-2.34.0/gold/layout.cc
3dad3f
--- binutils.orig/gold/layout.cc	2020-07-24 09:12:29.243306433 +0100
3dad3f
+++ binutils-2.34.0/gold/layout.cc	2020-07-24 09:15:11.464320064 +0100
3dad3f
@@ -1986,7 +1986,7 @@ Layout::attach_allocated_section_to_segm
3dad3f
   seg_flags |= os->extra_segment_flags();
3dad3f
 
3dad3f
   // Check for --section-start.
3dad3f
-  uint64_t addr;
3dad3f
+  uint64_t addr = 0;
3dad3f
   bool is_address_set = parameters->options().section_start(os->name(), &addr);
3dad3f
 
3dad3f
   // In general the only thing we really care about for PT_LOAD
3dad3f
diff -rup binutils.orig/binutils/dlltool.c binutils-2.34.0/binutils/dlltool.c
3dad3f
--- binutils.orig/binutils/dlltool.c	2020-07-24 09:12:28.974308069 +0100
3dad3f
+++ binutils-2.34.0/binutils/dlltool.c	2020-07-24 12:09:37.527121295 +0100
3dad3f
@@ -1305,7 +1305,7 @@ run (const char *what, char *args)
3dad3f
   int pid, wait_status;
3dad3f
   int i;
3dad3f
   const char **argv;
3dad3f
-  char *errmsg_fmt, *errmsg_arg;
3dad3f
+  char *errmsg_fmt = "", *errmsg_arg = "";
3dad3f
   char *temp_base = choose_temp_base ();
3dad3f
 
3dad3f
   inform (_("run: %s %s"), what, args);
3dad3f
diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c
3dad3f
--- binutils.orig/gas/config/tc-arm.c	2020-07-24 09:12:32.368287432 +0100
3dad3f
+++ binutils-2.34.0/gas/config/tc-arm.c	2020-07-24 12:14:19.842360634 +0100
3dad3f
@@ -28416,9 +28416,12 @@ md_apply_fix (fixS *	fixP,
3dad3f
 	 perform relaxation.  */
3dad3f
       if (value == -2)
3dad3f
 	{
3dad3f
-	  newval = md_chars_to_number (buf, THUMB_SIZE);
3dad3f
-	  newval = 0xbf00; /* NOP encoding T1 */
3dad3f
-	  md_number_to_chars (buf, newval, THUMB_SIZE);
3dad3f
+	  if (fixP->fx_done || !seg->use_rela_p)
3dad3f
+	    {
3dad3f
+	      newval = md_chars_to_number (buf, THUMB_SIZE);
3dad3f
+	      newval = 0xbf00; /* NOP encoding T1 */
3dad3f
+	      md_number_to_chars (buf, newval, THUMB_SIZE);
3dad3f
+	    }
3dad3f
 	}
3dad3f
       else
3dad3f
 	{
3dad3f
@@ -28631,17 +28634,14 @@ md_apply_fix (fixS *	fixP,
3dad3f
     case BFD_RELOC_ARM_GOTFUNCDESC:
3dad3f
     case BFD_RELOC_ARM_GOTOFFFUNCDESC:
3dad3f
     case BFD_RELOC_ARM_FUNCDESC:
3dad3f
-      if (arm_fdpic)
3dad3f
-	{
3dad3f
-	  if (fixP->fx_done || !seg->use_rela_p)
3dad3f
-	    md_number_to_chars (buf, 0, 4);
3dad3f
-	}
3dad3f
-      else
3dad3f
+      if (!arm_fdpic)
3dad3f
 	{
3dad3f
 	  as_bad_where (fixP->fx_file, fixP->fx_line,
3dad3f
 			_("Relocation supported only in FDPIC mode"));
3dad3f
-      }
3dad3f
-      break;
3dad3f
+	  break;
3dad3f
+	}
3dad3f
+      value = 0;
3dad3f
+      /* Fall through.  */
3dad3f
 #endif
3dad3f
 
3dad3f
     case BFD_RELOC_RVA:
3dad3f
diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c
3dad3f
--- binutils.orig/gas/config/tc-arm.c	2020-07-24 12:16:02.099719884 +0100
3dad3f
+++ binutils-2.34.0/gas/config/tc-arm.c	2020-07-24 12:34:17.690858328 +0100
3dad3f
@@ -28641,7 +28641,7 @@ md_apply_fix (fixS *	fixP,
3dad3f
 	  break;
3dad3f
 	}
3dad3f
       value = 0;
3dad3f
-      /* Fall through.  */
3dad3f
+      goto fred;
3dad3f
 #endif
3dad3f
 
3dad3f
     case BFD_RELOC_RVA:
3dad3f
@@ -28653,6 +28653,7 @@ md_apply_fix (fixS *	fixP,
3dad3f
 #ifdef TE_PE
3dad3f
     case BFD_RELOC_32_SECREL:
3dad3f
 #endif
3dad3f
+    fred:
3dad3f
       if (fixP->fx_done || !seg->use_rela_p)
3dad3f
 #ifdef TE_WINCE
3dad3f
 	/* For WinCE we only do this for pcrel fixups.  */
3dad3f
diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c
3dad3f
--- binutils.orig/gas/config/tc-arm.c	2020-07-24 13:28:26.926553452 +0100
3dad3f
+++ binutils-2.34.0/gas/config/tc-arm.c	2020-07-24 13:31:57.835215763 +0100
3dad3f
@@ -28416,12 +28416,8 @@ md_apply_fix (fixS *	fixP,
3dad3f
 	 perform relaxation.  */
3dad3f
       if (value == -2)
3dad3f
 	{
3dad3f
-	  if (fixP->fx_done || !seg->use_rela_p)
3dad3f
-	    {
3dad3f
-	      newval = md_chars_to_number (buf, THUMB_SIZE);
3dad3f
-	      newval = 0xbf00; /* NOP encoding T1 */
3dad3f
-	      md_number_to_chars (buf, newval, THUMB_SIZE);
3dad3f
-	    }
3dad3f
+	  newval = 0xbf00; /* NOP encoding T1 */
3dad3f
+	  goto jim;
3dad3f
 	}
3dad3f
       else
3dad3f
 	{
3dad3f
@@ -28432,6 +28428,7 @@ md_apply_fix (fixS *	fixP,
3dad3f
 	    {
3dad3f
 	      newval = md_chars_to_number (buf, THUMB_SIZE);
3dad3f
 	      newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3);
3dad3f
+	    jim:
3dad3f
 	      md_number_to_chars (buf, newval, THUMB_SIZE);
3dad3f
 	    }
3dad3f
 	}
3dad3f
diff -rup binutils.orig/binutils/mclex.c binutils-2.34.0/binutils/mclex.c
3dad3f
--- binutils.orig/binutils/mclex.c	2020-07-24 13:28:26.297557441 +0100
3dad3f
+++ binutils-2.34.0/binutils/mclex.c	2020-07-24 14:46:53.587940149 +0100
3dad3f
@@ -207,7 +207,7 @@ enum_severity (int e)
3dad3f
 static void
3dad3f
 mc_add_keyword_ascii (const char *sz, int rid, const char *grp, rc_uint_type nv, const char *sv)
3dad3f
 {
3dad3f
-  unichar *usz, *usv = NULL;
3dad3f
+  unichar *usz = NULL, *usv = NULL;
3dad3f
   rc_uint_type usz_len;
3dad3f
 
3dad3f
   unicode_from_codepage (&usz_len, &usz, sz, CP_ACP);
3dad3f
diff -rup binutils.orig/binutils/windmc.c binutils-2.34.0/binutils/windmc.c
3dad3f
--- binutils.orig/binutils/windmc.c	2020-07-24 13:28:26.279557556 +0100
3dad3f
+++ binutils-2.34.0/binutils/windmc.c	2020-07-24 14:48:05.460477478 +0100
3dad3f
@@ -338,7 +338,7 @@ mc_add_node_lang (mc_node *root, const m
3dad3f
 static char *
3dad3f
 convert_unicode_to_ACP (const unichar *usz)
3dad3f
 {
3dad3f
-  char *s;
3dad3f
+  char *s = NULL;
3dad3f
   rc_uint_type l;
3dad3f
 
3dad3f
   if (! usz)
3dad3f
@@ -607,10 +607,10 @@ mc_generate_bin_item (mc_node_lang *n, r
3dad3f
   else
3dad3f
     {
3dad3f
       rc_uint_type txt_len, l;
3dad3f
-      char *cvt_txt;
3dad3f
+      char *cvt_txt = NULL;
3dad3f
 
3dad3f
       codepage_from_unicode( &l, n->message, &cvt_txt, n->lang->lang_info.wincp);
3dad3f
-      if (! cvt_txt)
3dad3f
+      if (cvt_txt == NULL)
3dad3f
 	fatal ("Failed to convert message to language codepage.\n");
3dad3f
       txt_len = strlen (cvt_txt);
3dad3f
       if (mcset_automatic_null_termination && txt_len > 0)
3dad3f
@@ -1107,7 +1107,7 @@ main (int argc, char **argv)
3dad3f
 
3dad3f
   /* Load the input file and do code page transformations to UTF16.  */
3dad3f
   {
3dad3f
-    unichar *u;
3dad3f
+    unichar *u = NULL;
3dad3f
     rc_uint_type ul;
3dad3f
     char *buff;
3dad3f
     bfd_size_type flen;