Blame SOURCES/binutils-rh1048848.patch

214a23
diff -Nrup a/binutils/strings.c b/binutils/strings.c
214a23
--- a/binutils/strings.c	2013-02-27 13:28:03.000000000 -0700
214a23
+++ b/binutils/strings.c	2014-01-06 11:26:21.939427032 -0700
214a23
@@ -456,7 +456,18 @@ get_char (FILE *stream, file_ptr *addres
214a23
 {
214a23
   int c, i;
214a23
   long r = EOF;
214a23
-  unsigned char buf[4];
214a23
+  /* Aggressive optimizations might expose elements of BUF as individual
214a23
+     objects and then uninitialized analysis may be performed on those
214a23
+     elements.
214a23
+
214a23
+     If that happens, the compiler can/will warn in the switch statement
214a23
+     below because it does not know the relationship between ENCODING_BYTES
214a23
+     and ENCODING which prevents uninitialized uses.
214a23
+
214a23
+     Just initialize the object to zeros, which seems to be the best of
214a23
+     several bad solutions (#pragma GCC diagnostic, exposing the
214a23
+     relationship between ENCODING_BYTES and ENCODING here, etc). */
214a23
+  unsigned char buf[4] = { 0 };
214a23
 
214a23
   for (i = 0; i < encoding_bytes; i++)
214a23
     {
214a23
diff -Nrup a/ld/ldfile.c b/ld/ldfile.c
214a23
--- a/ld/ldfile.c	2013-02-27 13:28:03.000000000 -0700
214a23
+++ b/ld/ldfile.c	2014-01-06 12:53:39.559070145 -0700
214a23
@@ -596,7 +596,7 @@ static void
214a23
 ldfile_open_command_file_1 (const char *name, bfd_boolean default_only)
214a23
 {
214a23
   FILE *ldlex_input_stack;
214a23
-  bfd_boolean sysrooted;
214a23
+  bfd_boolean sysrooted = FALSE;
214a23
 
214a23
   ldlex_input_stack = ldfile_find_command_file (name, default_only, &sysrooted);
214a23