[ARC] Add SYNTAX_NOP and SYNTAX_1OP for extension instructions
[deliverable/binutils-gdb.git] / gas / config / tc-pdp11.c
index 70273a086e8ec371f13ddd2878404eacd351f6ae..f6cf0251dc2634bb3ae5f5c6f935cb4d6cea9545 100644 (file)
@@ -1,6 +1,5 @@
 /* tc-pdp11.c - pdp11-specific -
-   Copyright 2001, 2002, 2004, 2005, 2007, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 2001-2016 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -31,7 +30,7 @@ extern int flonum_gen2vax (int, FLONUM_TYPE * f, LITTLENUM_TYPE *);
 /* A representation for PDP-11 machine code.  */
 struct pdp11_code
 {
-  char *error;
+  const char *error;
   int code;
   int additional;      /* Is there an additional word?  */
   int word;            /* Additional word, if any.  */
@@ -86,7 +85,7 @@ const pseudo_typeS md_pseudo_table[] =
 static struct hash_control *insn_hash = NULL;
 \f
 static int
-set_option (char *arg)
+set_option (const char *arg)
 {
   int yes = 1;
 
@@ -280,9 +279,7 @@ md_apply_fix (fixS *fixP,
 }
 
 long
-md_chars_to_number (con, nbytes)
-     unsigned char con[];      /* Low order byte 1st.  */
-     int nbytes;               /* Number of bytes in the input.  */
+md_chars_to_number (unsigned char *con, int nbytes)
 {
   /* On a PDP-11, 0x1234 is stored as "\x12\x34", and
      0x12345678 is stored as "\x56\x78\x12\x34". It's
@@ -501,8 +498,6 @@ parse_op_no_deferred (char *str, struct pdp11_code *operand)
       /* label, d(rn), -(rn)  */
     default:
       {
-       char *old = str;
-
        if (strncmp (str, "-(", 2) == 0)        /* -(rn) */
          {
            str = parse_reg (str + 2, operand);
@@ -527,11 +522,6 @@ parse_op_no_deferred (char *str, struct pdp11_code *operand)
 
        if (*str != '(')
          {
-           if (operand->reloc.exp.X_op != O_symbol)
-             {
-               operand->error = _("Label expected");
-               return old;
-             }
            operand->code = 067;
            operand->additional = 1;
            operand->word = 0;
@@ -659,7 +649,7 @@ md_assemble (char *instruction_string)
   struct pdp11_code insn, op1, op2;
   int error;
   int size;
-  char *err = NULL;
+  const char *err = NULL;
   char *str;
   char *p;
   char c;
@@ -705,8 +695,6 @@ md_assemble (char *instruction_string)
     {
     case PDP11_OPCODE_NO_OPS:
       str = skip_whitespace (str);
-      if (*str == 0)
-       str = "";
       break;
 
     case PDP11_OPCODE_IMM3:
@@ -752,8 +740,8 @@ md_assemble (char *instruction_string)
 
     case PDP11_OPCODE_DISPL:
       {
-       char *new;
-       new = parse_expression (str, &op1);
+       char *new_pointer;
+       new_pointer = parse_expression (str, &op1);
        op1.code = 0;
        op1.reloc.pc_rel = 1;
        op1.reloc.type = BFD_RELOC_PDP11_DISP_8_PCREL;
@@ -767,7 +755,7 @@ md_assemble (char *instruction_string)
            err = _("8-bit displacement out of range");
            break;
          }
-       str = new;
+       str = new_pointer;
        insn.code |= op1.code;
        insn.reloc = op1.reloc;
       }
@@ -935,7 +923,7 @@ md_assemble (char *instruction_string)
 
     case PDP11_OPCODE_REG_DISPL:
       {
-       char *new;
+       char *new_pointer;
        str = parse_reg (str, &op2);
        if (op2.error)
          break;
@@ -946,7 +934,7 @@ md_assemble (char *instruction_string)
            op1.error = _("Missing ','");
            break;
          }
-       new = parse_expression (str, &op1);
+       new_pointer = parse_expression (str, &op1);
        op1.code = 0;
        op1.reloc.pc_rel = 1;
        op1.reloc.type = BFD_RELOC_PDP11_DISP_6_PCREL;
@@ -960,7 +948,7 @@ md_assemble (char *instruction_string)
            err = _("6-bit displacement out of range");
            break;
          }
-       str = new;
+       str = new_pointer;
        insn.code |= op1.code;
        insn.reloc = op1.reloc;
       }
@@ -1053,7 +1041,7 @@ md_create_long_jump (char *ptr ATTRIBUTE_UNUSED,
 }
 
 static int
-set_cpu_model (char *arg)
+set_cpu_model (const char *arg)
 {
   char buf[4];
   char *model = buf;
@@ -1169,7 +1157,7 @@ set_cpu_model (char *arg)
 }
 
 static int
-set_machine_model (char *arg)
+set_machine_model (const char *arg)
 {
   if (strncmp (arg, "pdp-11/", 7) != 0
       && strncmp (arg, "pdp11/", 6) != 0
@@ -1256,7 +1244,7 @@ size_t md_longopts_size = sizeof (md_longopts);
    See if it's a processor-specific option.  */
 
 int
-md_parse_option (int c, char *arg)
+md_parse_option (int c, const char *arg)
 {
   init_defaults ();
 
@@ -1396,9 +1384,9 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED,
   arelent *reloc;
   bfd_reloc_code_real_type code;
 
-  reloc = xmalloc (sizeof (* reloc));
+  reloc = XNEW (arelent);
 
-  reloc->sym_ptr_ptr = xmalloc (sizeof (asymbol *));
+  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;
 
@@ -1454,7 +1442,7 @@ pseudo_even (int c ATTRIBUTE_UNUSED)
   record_alignment (now_seg, alignment);
 }
 
-char *
+const char *
 md_atof (int type, char * litP, int * sizeP)
 {
   return vax_md_atof (type, litP, sizeP);
This page took 0.026387 seconds and 4 git commands to generate.