Fix compile time warnings building the binutils with gcc 7.1.1.
authorNick Clifton <nickc@redhat.com>
Wed, 12 Jul 2017 11:17:02 +0000 (12:17 +0100)
committerNick Clifton <nickc@redhat.com>
Wed, 12 Jul 2017 11:17:02 +0000 (12:17 +0100)
bfd * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
plt_name buffer.
(elf_xtensa_get_gotplt_section): Increase length of got_name
buffer.
* mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
default return of FALSE.
* mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
default return of FALSE.

binutils * dwarf.c (dwarf_vmatoa_1): Do not pass a NULL string pointer to
sprintf.
* srconv.c (walk_tree_type): Initialise the spare field of the
IT_dty structure.

gas * config/tc-pru.c (md_assemble): Add continue statement after
handling 'E' operand character.
* config/tc-v850.c (md_assemble): Initialise the 'insn' variable.

bfd/ChangeLog
bfd/elf32-xtensa.c
bfd/mach-o-arm.c
bfd/mach-o-i386.c
binutils/ChangeLog
binutils/dwarf.c
binutils/srconv.c
gas/ChangeLog
gas/config/tc-pru.c
gas/config/tc-v850.c

index 54aa1c7ce402f449a33791cf9f31e0e304a964ce..a48935796d86abfcd44e85c91b6a6ce43acedf68 100644 (file)
@@ -1,3 +1,15 @@
+2017-07-12  Nick Clifton  <nickc@redhat.com>
+
+       Fix compile time warnings using gcc 7.1.1.
+       * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
+       plt_name buffer.
+       (elf_xtensa_get_gotplt_section): Increase length of got_name
+       buffer.
+       * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
+       default return of FALSE.
+       * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
+       default return of FALSE.
+
 2017-07-12  Alan Modra  <amodra@gmail.com>
 
        * binary.c (binary_set_section_contents): Don't print filepos in
index b3ddbf1e243bcd783e337328dc9a64cd8b140a8d..19a162eebbbadc88c833708a83bd6c3cb76c940c 100644 (file)
@@ -10841,7 +10841,7 @@ static asection *
 elf_xtensa_get_plt_section (struct bfd_link_info *info, int chunk)
 {
   bfd *dynobj;
-  char plt_name[10];
+  char plt_name[17];
 
   if (chunk == 0)
     return elf_hash_table (info)->splt;
@@ -10856,7 +10856,7 @@ static asection *
 elf_xtensa_get_gotplt_section (struct bfd_link_info *info, int chunk)
 {
   bfd *dynobj;
-  char got_name[14];
+  char got_name[21];
 
   if (chunk == 0)
     return elf_hash_table (info)->sgotplt;
index e7315225dd4f02b219062632b84ad9d8cf417a6a..5139f795f2429fb445d2600dfff45332cb894bf3 100644 (file)
@@ -150,7 +150,7 @@ static bfd_boolean
 bfd_mach_o_arm_canonicalize_one_reloc (bfd *abfd,
                                       struct mach_o_reloc_info_external *raw,
                                       arelent *res, asymbol **syms)
- {
+{
   bfd_mach_o_reloc_info reloc;
 
   if (!bfd_mach_o_pre_canonicalize_one_reloc (abfd, raw, &reloc, res, syms))
@@ -174,6 +174,7 @@ bfd_mach_o_arm_canonicalize_one_reloc (bfd *abfd,
              return TRUE;
            }
           return FALSE;
+
         case BFD_MACH_O_ARM_RELOC_SECTDIFF:
           if (reloc.r_length == 2)
             {
@@ -186,6 +187,7 @@ bfd_mach_o_arm_canonicalize_one_reloc (bfd *abfd,
              return TRUE;
             }
           return FALSE;
+
         case BFD_MACH_O_ARM_RELOC_LOCAL_SECTDIFF:
           if (reloc.r_length == 2)
             {
@@ -198,6 +200,7 @@ bfd_mach_o_arm_canonicalize_one_reloc (bfd *abfd,
              return TRUE;
             }
           return FALSE;
+
        case BFD_MACH_O_ARM_RELOC_HALF_SECTDIFF:
          switch (reloc.r_length)
            {
@@ -209,8 +212,9 @@ bfd_mach_o_arm_canonicalize_one_reloc (bfd *abfd,
              return TRUE;
            }
          return FALSE;
+
         default:
-          return FALSE;
+          break;
         }
     }
   else
@@ -239,24 +243,23 @@ bfd_mach_o_arm_canonicalize_one_reloc (bfd *abfd,
               return FALSE;
             }
           break;
+
         case BFD_MACH_O_ARM_RELOC_BR24:
          if (reloc.r_length == 2 && reloc.r_pcrel == 1)
            {
               res->howto = &arm_howto_table[11];
               return TRUE;
            }
-         else
-           return FALSE;
          break;
+
         case BFD_MACH_O_THUMB_RELOC_BR22:
          if (reloc.r_length == 2 && reloc.r_pcrel == 1)
            {
               res->howto = &arm_howto_table[16];
               return TRUE;
            }
-         else
-           return FALSE;
          break;
+
         case BFD_MACH_O_ARM_RELOC_HALF:
          if (reloc.r_pcrel == 0)
            switch (reloc.r_length)
@@ -268,7 +271,8 @@ bfd_mach_o_arm_canonicalize_one_reloc (bfd *abfd,
                res->howto = &arm_howto_table[14];
                return TRUE;
              }
-         return FALSE;
+         break;
+
         case BFD_MACH_O_ARM_RELOC_PAIR:
          if (res[-1].howto == &arm_howto_table[12]
              && reloc.r_length == 0)
@@ -290,11 +294,14 @@ bfd_mach_o_arm_canonicalize_one_reloc (bfd *abfd,
              res->address = res[-1].address;
              return TRUE;
             }
-          return FALSE;
+         break;
+
         default:
-          return FALSE;
+         break;
         }
     }
+
+  return FALSE;
 }
 
 static reloc_howto_type *
index b2f02415c3ae019224b25184539237d530c5bc7e..ce0389e020ceaf259f046598e5fb16b83c24bbb5 100644 (file)
@@ -164,7 +164,7 @@ bfd_mach_o_i386_canonicalize_one_reloc (bfd *abfd,
             }
           return FALSE;
         default:
-          return FALSE;
+         break;
         }
     }
   else
@@ -192,11 +192,11 @@ bfd_mach_o_i386_canonicalize_one_reloc (bfd *abfd,
             default:
               return FALSE;
             }
-          break;
         default:
-          return FALSE;
+          break;
         }
     }
+  return FALSE;
 }
 
 static bfd_boolean
index 254be5e59ce284add325e809afaf41f3392b6500..1a9c39fe69ee59862f6b64f27acce56763a1e5c4 100644 (file)
@@ -1,3 +1,11 @@
+2017-07-12  Nick Clifton  <nickc@redhat.com>
+
+       Fix compile time warnings using gcc 7.1.1.
+       * dwarf.c (dwarf_vmatoa_1): Do not pass a NULL string pointer to
+       sprintf.
+       * srconv.c (walk_tree_type): Initialise the spare field of the
+       IT_dty structure.
+
 2017-07-11  Andreas Schwab  <schwab@suse.de>
 
        * readelf.c (process_note): Print newline after description data
index 386cc17f7c5a07da0b5e10244e02a3c36c893715..5f8922eb8aad224fd7844b6fa44ecda3c39a4512 100644 (file)
@@ -217,7 +217,10 @@ dwarf_vmatoa_1 (const char *fmtch, dwarf_vma value, unsigned num_bytes)
     {
       char fmt[32];
 
-      sprintf (fmt, "%%%s%s", DWARF_VMA_FMT, fmtch);
+      if (fmtch)
+       sprintf (fmt, "%%%s%s", DWARF_VMA_FMT, fmtch);
+      else
+       sprintf (fmt, "%%%s", DWARF_VMA_FMT);
       snprintf (ret, sizeof (buf[0].place), fmt, value);
       return ret;
     }
index 87c503d249f7a18f0f9261f76730c4ec69d650df..a033bc85e3acfb81b86df5960eaedd3074c81b14 100644 (file)
@@ -874,13 +874,14 @@ static void
 walk_tree_type (struct coff_sfile *sfile, struct coff_symbol *symbol,
                struct coff_type *type, int nest)
 {
-  if (symbol->type->type == coff_function_type)
-    {
-      struct IT_dty dty;
+  struct IT_dty dty;
 
-      dty.end = 0;
-      dty.neg = 0x1001;
+  dty.spare = 0;
+  dty.end = 0;
+  dty.neg = 0x1001;
 
+  if (symbol->type->type == coff_function_type)
+    {
       sysroff_swap_dty_out (file, &dty);
       walk_tree_type_1 (sfile, symbol, type, nest);
       dty.end = 1;
@@ -906,10 +907,6 @@ walk_tree_type (struct coff_sfile *sfile, struct coff_symbol *symbol,
     }
   else
     {
-      struct IT_dty dty;
-
-      dty.end = 0;
-      dty.neg = 0x1001;
       sysroff_swap_dty_out (file, &dty);
       walk_tree_type_1 (sfile, symbol, type, nest);
       dty.end = 1;
index 829256a9432053f36e649fac6ab1e53864dee820..e2c8f534bf2e09d080fcb21572e57ac00de33e45 100644 (file)
@@ -1,3 +1,10 @@
+2017-07-12  Nick Clifton  <nickc@redhat.com>
+
+       Fix compile time warnings using gcc 7.1.1.
+       * config/tc-pru.c (md_assemble): Add continue statement after
+       handling 'E' operand character.
+       * config/tc-v850.c (md_assemble): Initialise the 'insn' variable.
+
 2017-07-05  James Greenhalgh  <james.greenhalgh@arm.com>
 
        * config/tc-arm.c (arm_cpus): Add Cortex-A55 and Cortex-A75.
index 53ea7ef2b9deb787379a4395fa67f4f8ce4bc0a1..d5aa5a5146bf67fd4e4e84dafad49a2bb27b438c 100644 (file)
@@ -296,9 +296,10 @@ typedef enum
 static PRU_MODE pru_mode = PRU_MODE_ASSEMBLE;
 
 /* This function is used to in self-checking mode
-   to check the assembled instruction
-   opcode should be the assembled opcode, and exp_opcode
+   to check the assembled instruction.
+   OPCODE should be the assembled opcode, and exp_opcode
    the parsed string representing the expected opcode.  */
+
 static void
 pru_check_assembly (unsigned int opcode, const char *exp_opcode)
 {
@@ -1698,6 +1699,8 @@ md_assemble (char *op_str)
 
            case 'E':
              pru_check_assembly (insn->insn_code, *argtk++);
+             continue;
+
            default:
              BAD_CASE (*argp);
            }
index 7b5347480ad867d88c09924a3908e0e69c9a7c1c..dd7b54ad28f7b5179cd7944c80cdc92bb0b8a866 100644 (file)
@@ -2298,7 +2298,7 @@ md_assemble (char *str)
   const unsigned char *opindex_ptr;
   int next_opindex;
   int relaxable = 0;
-  unsigned long insn;
+  unsigned long insn = 0;
   unsigned long insn_size;
   char *f = NULL;
   int i;
@@ -3065,7 +3065,6 @@ md_assemble (char *str)
   dwarf2_emit_insn (0);
 
   /* Write out the instruction.  */
-
   if (relaxable && fc > 0)
     {
       insn_size = 2;
This page took 0.033516 seconds and 4 git commands to generate.