i386: Add tests for -malign-branch-boundary and -malign-branch
[deliverable/binutils-gdb.git] / gas / config / tc-cris.c
index 25c9ea58bada9459bfd88ed56b64742d5e6e4c3e..198a2d71c9e7b88d6e26ddadd3f7c16f7eba0efd 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-cris.c -- Assembler code for the CRIS CPU core.
 /* tc-cris.c -- Assembler code for the CRIS CPU core.
-   Copyright (C) 2000-2015 Free Software Foundation, Inc.
+   Copyright (C) 2000-2019 Free Software Foundation, Inc.
 
    Contributed by Axis Communications AB, Lund, Sweden.
    Originally written for GAS 1.38.1 by Mikael Asker.
 
    Contributed by Axis Communications AB, Lund, Sweden.
    Originally written for GAS 1.38.1 by Mikael Asker.
@@ -81,7 +81,7 @@ struct cris_prefix
   expressionS expr;
 
   /* If there's an expression, we might need a relocation.  Here's the
   expressionS expr;
 
   /* If there's an expression, we might need a relocation.  Here's the
-     type of what relocation to start relaxaton with.
+     type of what relocation to start relaxation with.
      The relocation is assumed to start immediately after the prefix insn,
      so we don't provide an offset.  */
   enum bfd_reloc_code_real reloc;
      The relocation is assumed to start immediately after the prefix insn,
      so we don't provide an offset.  */
   enum bfd_reloc_code_real reloc;
@@ -119,7 +119,7 @@ enum cris_archs
   arch_cris_any_v0_v10, arch_crisv32, arch_cris_common_v10_v32
 };
 
   arch_cris_any_v0_v10, arch_crisv32, arch_cris_common_v10_v32
 };
 
-static enum cris_archs cris_arch_from_string (char **);
+static enum cris_archs cris_arch_from_string (const char **);
 static int cris_insn_ver_valid_for_arch (enum cris_insn_version_usage,
                                         enum cris_archs);
 
 static int cris_insn_ver_valid_for_arch (enum cris_insn_version_usage,
                                         enum cris_archs);
 
@@ -3591,7 +3591,7 @@ cris_get_reloc_suffix (char **cPP, bfd_reloc_code_real_type *relocp,
    code as assembly code, but if they do, they should be able enough to
    find out the correct bit patterns and use them.  */
 
    code as assembly code, but if they do, they should be able enough to
    find out the correct bit patterns and use them.  */
 
-char *
+const char *
 md_atof (int type ATTRIBUTE_UNUSED, char *litp ATTRIBUTE_UNUSED,
         int *sizep ATTRIBUTE_UNUSED)
 {
 md_atof (int type ATTRIBUTE_UNUSED, char *litp ATTRIBUTE_UNUSED,
         int *sizep ATTRIBUTE_UNUSED)
 {
@@ -3802,7 +3802,7 @@ cris_number_to_imm (char *bufp, long val, int n, fixS *fixP, segT seg)
    GAS does not understand.  */
 
 int
    GAS does not understand.  */
 
 int
-md_parse_option (int arg, char *argp ATTRIBUTE_UNUSED)
+md_parse_option (int arg, const char *argp ATTRIBUTE_UNUSED)
 {
   switch (arg)
     {
 {
   switch (arg)
     {
@@ -3842,7 +3842,7 @@ md_parse_option (int arg, char *argp ATTRIBUTE_UNUSED)
 
     case OPTION_ARCH:
       {
 
     case OPTION_ARCH:
       {
-       char *str = argp;
+       const char *str = argp;
        enum cris_archs argarch = cris_arch_from_string (&str);
 
        if (argarch == arch_cris_unknown)
        enum cris_archs argarch = cris_arch_from_string (&str);
 
        if (argarch == arch_cris_unknown)
@@ -3959,9 +3959,9 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixP)
       return 0;
     }
 
       return 0;
     }
 
-  relP = (arelent *) xmalloc (sizeof (arelent));
+  relP = XNEW (arelent);
   gas_assert (relP != 0);
   gas_assert (relP != 0);
-  relP->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+  relP->sym_ptr_ptr = XNEW (asymbol *);
   *relP->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
   relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
 
   *relP->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy);
   relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
 
@@ -4054,23 +4054,15 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg)
   if (fixP->fx_addsy == 0 && !fixP->fx_pcrel)
     fixP->fx_done = 1;
 
   if (fixP->fx_addsy == 0 && !fixP->fx_pcrel)
     fixP->fx_done = 1;
 
-  if (fixP->fx_bit_fixP || fixP->fx_im_disp != 0)
-    {
-      as_bad_where (fixP->fx_file, fixP->fx_line, _("Invalid relocation"));
-      fixP->fx_done = 1;
-    }
-  else
-    {
-      /* We can't actually support subtracting a symbol.  */
-      if (fixP->fx_subsy != (symbolS *) NULL)
-       as_bad_where (fixP->fx_file, fixP->fx_line,
-                     _("expression too complex"));
+  /* We can't actually support subtracting a symbol.  */
+  if (fixP->fx_subsy != (symbolS *) NULL)
+    as_bad_where (fixP->fx_file, fixP->fx_line,
+                 _("expression too complex"));
 
 
-      /* This operand-type is scaled.  */
-      if (fixP->fx_r_type == BFD_RELOC_CRIS_LAPCQ_OFFSET)
-       val /= 2;
-      cris_number_to_imm (buf, val, fixP->fx_size, fixP, seg);
-    }
+  /* This operand-type is scaled.  */
+  if (fixP->fx_r_type == BFD_RELOC_CRIS_LAPCQ_OFFSET)
+    val /= 2;
+  cris_number_to_imm (buf, val, fixP->fx_size, fixP, seg);
 }
 
 /* All relocations are relative to the location just after the fixup;
 }
 
 /* All relocations are relative to the location just after the fixup;
@@ -4271,7 +4263,7 @@ s_cris_dtpoff (int bytes)
    arch_cris_unknown is returned.  */
 
 static enum cris_archs
    arch_cris_unknown is returned.  */
 
 static enum cris_archs
-cris_arch_from_string (char **str)
+cris_arch_from_string (const char **str)
 {
   static const struct cris_arch_struct
   {
 {
   static const struct cris_arch_struct
   {
@@ -4398,7 +4390,7 @@ s_cris_arch (int dummy ATTRIBUTE_UNUSED)
      would be more useful than confusing, implementation-wise and
      user-wise.  */
 
      would be more useful than confusing, implementation-wise and
      user-wise.  */
 
-  char *str = input_line_pointer;
+  const char *str = input_line_pointer;
   enum cris_archs arch = cris_arch_from_string (&str);
 
   if (arch == arch_cris_unknown)
   enum cris_archs arch = cris_arch_from_string (&str);
 
   if (arch == arch_cris_unknown)
@@ -4414,7 +4406,7 @@ s_cris_arch (int dummy ATTRIBUTE_UNUSED)
   else if (arch != cris_arch)
     as_bad (_(".arch <arch> requires a matching --march=... option"));
 
   else if (arch != cris_arch)
     as_bad (_(".arch <arch> requires a matching --march=... option"));
 
-  input_line_pointer = str;
+  input_line_pointer = (char *) str;
   demand_empty_rest_of_line ();
   return;
 }
   demand_empty_rest_of_line ();
   return;
 }
This page took 0.031168 seconds and 4 git commands to generate.