Add support for ARM Cortex-M33 processor
[deliverable/binutils-gdb.git] / gas / config / tc-metag.c
index 8d78349bc0c30fe575731e3bfc8429197888ca2d..b56f9d21a7bd46d11bc9610458ac055a732f9b9b 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-metag.c -- Assembler for the Imagination Technologies Meta.
-   Copyright (C) 2013-2015 Free Software Foundation, Inc.
+   Copyright (C) 2013-2016 Free Software Foundation, Inc.
    Contributed by Imagination Technologies Ltd.
 
    This file is part of GAS, the GNU Assembler.
@@ -24,7 +24,6 @@
 #include "symcat.h"
 #include "safe-ctype.h"
 #include "hashtab.h"
-#include "libbfd.h"
 
 #include <stdio.h>
 
@@ -2041,6 +2040,7 @@ parse_swap (const char *line, metag_insn *insn,
          as_bad (_("PC, CT, TR and TT are treated as if they are a single unit but operands must be in different units"));
          return NULL;
        }
+      break;
 
     default:
       /* Registers must be in different units.  */
@@ -2683,6 +2683,7 @@ parse_alu (const char *line, metag_insn *insn,
              insn->bits |= (1 << 7);
              break;
            }
+         /* Fall through.  */
        default:
          as_bad (_("invalid quickrot register specified"));
          return NULL;
@@ -5791,7 +5792,7 @@ static const insn_parser insn_parsers[ENC_MAX] =
 
 struct metag_core_option
 {
-  char *name;
+  const char *name;
   unsigned int value;
 };
 
@@ -5821,7 +5822,7 @@ static const struct metag_core_option metag_dsps[] =
 
 /* Parse a CPU command line option.  */
 static int
-metag_parse_cpu (char * str)
+metag_parse_cpu (const char * str)
 {
   const struct metag_core_option * opt;
   int optlen;
@@ -5847,7 +5848,7 @@ metag_parse_cpu (char * str)
 
 /* Parse an FPU command line option.  */
 static int
-metag_parse_fpu (char * str)
+metag_parse_fpu (const char * str)
 {
   const struct metag_core_option * opt;
   int optlen;
@@ -5873,7 +5874,7 @@ metag_parse_fpu (char * str)
 
 /* Parse a DSP command line option.  */
 static int
-metag_parse_dsp (char * str)
+metag_parse_dsp (const char * str)
 {
   const struct metag_core_option * opt;
   int optlen;
@@ -5899,10 +5900,10 @@ metag_parse_dsp (char * str)
 
 struct metag_long_option
 {
-  char * option;                /* Substring to match.  */
-  char * help;                  /* Help information.  */
-  int (* func) (char * subopt); /* Function to decode sub-option.  */
-  char * deprecated;            /* If non-null, print this message.  */
+  const char * option;                /* Substring to match.  */
+  const char * help;                  /* Help information.  */
+  int (* func) (const char * subopt); /* Function to decode sub-option.  */
+  const char * deprecated;            /* If non-null, print this message.  */
 };
 
 struct metag_long_option metag_long_opts[] =
@@ -5917,7 +5918,7 @@ struct metag_long_option metag_long_opts[] =
   };
 
 int
-md_parse_option (int c, char * arg)
+md_parse_option (int c, const char * arg)
 {
   struct metag_long_option *lopt;
 
@@ -6331,7 +6332,7 @@ create_mnemonic_htab (void)
       insn_templates **slot = NULL;
       insn_templates *new_entry;
 
-      new_entry = xmalloc (sizeof (insn_templates));
+      new_entry = XNEW (insn_templates);
 
       new_entry->template = template;
       new_entry->next = NULL;
@@ -6416,7 +6417,7 @@ create_dspreg_htabs (void)
 
       /* Make sure there are no hash table collisions, which would
         require chaining entries.  */
-      BFD_ASSERT (*slot == NULL);
+      gas_assert (*slot == NULL);
       *slot = reg;
     }
 
@@ -6439,7 +6440,7 @@ create_dspreg_htabs (void)
 
          /* Make sure there are no hash table collisions, which would
             require chaining entries.  */
-         BFD_ASSERT (*slot == NULL);
+         gas_assert (*slot == NULL);
          *slot = reg;
        }
     }
@@ -6486,7 +6487,7 @@ create_scond_htab (void)
                                                        scond, INSERT);
       /* Make sure there are no hash table collisions, which would
         require chaining entries.  */
-      BFD_ASSERT (*slot == NULL);
+      gas_assert (*slot == NULL);
       *slot = scond;
     }
 }
@@ -6707,7 +6708,7 @@ md_number_to_chars (char * buf, valueT val, int n)
 /* Equal to MAX_PRECISION in atof-ieee.c */
 #define MAX_LITTLENUMS 6
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   int              i;
@@ -6847,7 +6848,7 @@ md_convert_frag (bfd * abfd ATTRIBUTE_UNUSED, segT sec ATTRIBUTE_UNUSED,
 void
 metag_handle_align (fragS * fragP)
 {
-  static char const noop[4] = { 0xfe, 0xff, 0xff, 0xa0 };
+  static unsigned char const noop[4] = { 0xfe, 0xff, 0xff, 0xa0 };
   int bytes, fix;
   char *p;
 
@@ -6879,7 +6880,7 @@ metag_handle_align (fragS * fragP)
 }
 
 static char *
-metag_end_of_match (char * cont, char * what)
+metag_end_of_match (char * cont, const char * what)
 {
   int len = strlen (what);
 
@@ -7002,14 +7003,12 @@ metag_parse_name (char const * name, expressionS * exprP, enum expr_mode mode,
    then it is done here.  */
 
 arelent *
-tc_gen_reloc (seg, fixp)
-     asection *seg ATTRIBUTE_UNUSED;
-     fixS *fixp;
+tc_gen_reloc (asection *seg ATTRIBUTE_UNUSED, fixS *fixp)
 {
   arelent *reloc;
 
-  reloc                      = (arelent *) xmalloc (sizeof (arelent));
-  reloc->sym_ptr_ptr  = (asymbol **) xmalloc (sizeof (asymbol *));
+  reloc                      = XNEW (arelent);
+  reloc->sym_ptr_ptr  = XNEW (asymbol *);
   *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
   reloc->address      = fixp->fx_frag->fr_address + fixp->fx_where;
 
@@ -7112,6 +7111,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
       break;
     case BFD_RELOC_64:
       md_number_to_chars (buf, value, 8);
+      break;
 
     case BFD_RELOC_METAG_RELBRANCH:
       if (!value)
This page took 0.031952 seconds and 4 git commands to generate.