x86: replace NoRex64 on VEX-encoded insns
[deliverable/binutils-gdb.git] / gas / config / tc-dlx.c
index 970e297b94a4dd0f0461a6fe0f96af2ea806b8ff..3f64025575d84fd804c47b5e7117654204b6cc5a 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-dlx.c -- Assemble for the DLX
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2020 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -24,6 +24,8 @@
 #include "safe-ctype.h"
 #include "tc-dlx.h"
 #include "opcode/dlx.h"
+#include "elf/dlx.h"
+#include "bfd/elf32-dlx.h"
 
 /* Make it easier to clone this machine desc into another one.  */
 #define        machine_opcode      dlx_opcode
@@ -52,7 +54,7 @@ struct machine_it
   int pcrel;
   int size;
   int reloc_offset;            /* Offset of reloc within insn.  */
-  int reloc;
+  bfd_reloc_code_real_type reloc;
   int HI;
   int LO;
 }
@@ -245,7 +247,7 @@ s_proc (int end_p)
          if (leading_char)
            {
              unsigned len = strlen (name) + 1;
-             label = xmalloc (len + 1);
+             label = XNEWVEC (char, len + 1);
              label[0] = leading_char;
              memcpy (label + 1, name, len);
            }
@@ -774,10 +776,11 @@ machine_ip (char *str)
          /* Macro move operand/reg.  */
          if (operand->X_op == O_register)
            {
-             /* Its a register.  */
+             /* It's a register.  */
              reg_shift = 21;
              goto general_reg;
            }
+         /* Fall through.  */
 
          /* The immediate 16 bits literal, bit 0-15.  */
        case 'i':
@@ -930,7 +933,7 @@ md_assemble (char *str)
       switch (fixP->fx_r_type)
        {
        case RELOC_DLX_REL26:
-         bitP = malloc (sizeof (bit_fixS));
+         bitP = XNEW (bit_fixS);
          bitP->fx_bit_size = 26;
          bitP->fx_bit_offset = 25;
          bitP->fx_bit_base = the_insn.opcode & 0xFC000000;
@@ -942,7 +945,7 @@ md_assemble (char *str)
          break;
        case RELOC_DLX_LO16:
        case RELOC_DLX_REL16:
-         bitP = malloc (sizeof (bit_fixS));
+         bitP = XNEW (bit_fixS);
          bitP->fx_bit_size = 16;
          bitP->fx_bit_offset = 15;
          bitP->fx_bit_base = the_insn.opcode & 0xFFFF0000;
@@ -953,7 +956,7 @@ md_assemble (char *str)
          fixP->fx_bit_fixP = bitP;
          break;
        case RELOC_DLX_HI16:
-         bitP = malloc (sizeof (bit_fixS));
+         bitP = XNEW (bit_fixS);
          bitP->fx_bit_size = 16;
          bitP->fx_bit_offset = 15;
          bitP->fx_bit_base = the_insn.opcode & 0xFFFF0000;
@@ -974,7 +977,7 @@ md_assemble (char *str)
    but I'm not sure.  Dlx will not use it anyway, so I just leave it
    here for now.  */
 
-char *
+const char *
 md_atof (int type, char *litP, int *sizeP)
 {
   return ieee_md_atof (type, litP, sizeP, TRUE);
@@ -1011,10 +1014,6 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
          free (fixP->fx_bit_fixP);
          fixP->fx_bit_fixP = NULL;
        }
-#ifdef DEBUG
-      else
-       know ((fixP->fx_bit_fixP != NULL));
-#endif
       break;
 
     case RELOC_DLX_HI16:
@@ -1024,10 +1023,6 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
          free (fixP->fx_bit_fixP);
          fixP->fx_bit_fixP = NULL;
        }
-#ifdef DEBUG
-      else
-       know ((fixP->fx_bit_fixP != NULL));
-#endif
       break;
 
     case RELOC_DLX_REL26:
@@ -1037,10 +1032,6 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
          free (fixP->fx_bit_fixP);
          fixP->fx_bit_fixP = NULL;
        }
-#ifdef DEBUG
-      else
-       know ((fixP->fx_bit_fixP != NULL));
-#endif
       break;
 
     case BFD_RELOC_VTABLE_INHERIT:
@@ -1063,6 +1054,8 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
   number_to_chars_bigendian (place, val, fixP->fx_size);
   if (fixP->fx_addsy == NULL)
     fixP->fx_done = 1;
+  if (fixP->fx_bit_fixP != NULL)
+    fixP->fx_no_overflow = 1;
 }
 
 const char *md_shortopts = "";
@@ -1187,7 +1180,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED,
 {
   arelent * reloc;
 
-  reloc = xmalloc (sizeof (arelent));
+  reloc = XNEW (arelent);
   reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type);
 
   if (reloc->howto == NULL)
@@ -1201,7 +1194,7 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED,
 
   gas_assert (!fixP->fx_pcrel == !reloc->howto->pc_relative);
 
-  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;
 
This page took 0.027991 seconds and 4 git commands to generate.