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

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