2009-09-02 Paolo Bonzini <bonzini@gnu.org>
[deliverable/binutils-gdb.git] / gas / config / tc-alpha.c
index 9ae49fa8649ab5347354cb2cf03ac2a05a460caf..35d381283e89a07b275ce5a9799756becf41a8bc 100644 (file)
@@ -1,6 +1,7 @@
 /* tc-alpha.c - Processor-specific code for the DEC Alpha AXP CPU.
    Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002, 2003, 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+   2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
+   Free Software Foundation, Inc.
    Contributed by Carnegie Mellon University, 1993.
    Written by Alessandro Forin, based on earlier gas-1.38 target CPU files.
    Modified by Ken Raeburn for gas-2.x and ECOFF support.
@@ -355,7 +356,7 @@ static int alpha_addr32_on = 0;
    and the section happens to not be on an eight byte boundary, it
    will align both the symbol and the .quad to an eight byte boundary.  */
 static symbolS *alpha_insn_label;
-#ifdef OBJ_ELF
+#if defined(OBJ_ELF) || defined (OBJ_EVAX)
 static symbolS *alpha_prologue_label;
 #endif
 
@@ -593,7 +594,7 @@ get_alpha_reloc_tag (long sequence)
       strcpy (info->string, buffer);
       errmsg = hash_insert (alpha_literal_hash, info->string, (void *) info);
       if (errmsg)
-       as_fatal (errmsg);
+       as_fatal ("%s", errmsg);
 #ifdef OBJ_EVAX
       info->sym = 0;
       info->psym = 0;
@@ -1280,7 +1281,7 @@ load_expression (int targreg,
 
        assemble_tokens_to_insn ("ldq", newtok, 3, &insn);
 
-       assert (insn.nfixups == 1);
+       gas_assert (insn.nfixups == 1);
        insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITERAL;
        insn.sequence = emit_lituse = next_sequence_num--;
 #endif /* OBJ_ECOFF */
@@ -1316,7 +1317,7 @@ load_expression (int targreg,
 
        assemble_tokens_to_insn ("ldq", newtok, 3, &insn);
 
-       assert (insn.nfixups == 1);
+       gas_assert (insn.nfixups == 1);
        insn.fixups[0].reloc = BFD_RELOC_ALPHA_ELF_LITERAL;
        insn.sequence = emit_lituse = next_sequence_num--;
 #endif /* OBJ_ELF */
@@ -1376,7 +1377,7 @@ load_expression (int targreg,
                    memcpy (ensymname, ptr1, ptr2 - ptr1);
                    memcpy (ensymname + (ptr2 - ptr1), "..en", 5);
 
-                   assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
+                   gas_assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
                    insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_NOP;
                    ensym = symbol_find_or_make (ensymname);
                    ensym->sy_used = 1;
@@ -1405,7 +1406,7 @@ load_expression (int targreg,
                    psymname = (char *) xmalloc (ptr2 - ptr1 + 1);
                    memcpy (psymname, ptr1, ptr2 - ptr1);
                    psymname [ptr2 - ptr1] = 0;
-                   assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
+                   gas_assert (insn.nfixups + 1 <= MAX_INSN_FIXUPS);
                    insn.fixups[insn.nfixups].reloc = BFD_RELOC_ALPHA_LDA;
                    psym = symbol_find_or_make (psymname);
                    psym->sy_used = 1;
@@ -1544,7 +1545,7 @@ load_expression (int targreg,
 
       assemble_tokens_to_insn ("ldq", newtok, 3, &insn);
 
-      assert (insn.nfixups == 1);
+      gas_assert (insn.nfixups == 1);
 #ifdef OBJ_ECOFF
       insn.fixups[0].reloc = BFD_RELOC_ALPHA_LITERAL;
 #endif
@@ -1562,7 +1563,7 @@ load_expression (int targreg,
 
       assemble_tokens_to_insn ("ldq", newtok, 3, &insn);
 
-      assert (insn.nfixups < MAX_INSN_FIXUPS);
+      gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
       insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
       insn.fixups[insn.nfixups].exp.X_op = O_absent;
       insn.nfixups++;
@@ -1765,7 +1766,7 @@ emit_insn (struct alpha_insn *insn)
        {
          reloc_howto_type *reloc_howto
            = bfd_reloc_type_lookup (stdoutput, fixup->reloc);
-         assert (reloc_howto);
+         gas_assert (reloc_howto);
 
          size = bfd_get_reloc_size (reloc_howto);
 
@@ -1779,7 +1780,7 @@ emit_insn (struct alpha_insn *insn)
              break;
 #endif
            default:
-             assert (size >= 1 && size <= 4);
+             gas_assert (size >= 1 && size <= 4);
            }
  
          pcrel = reloc_howto->pc_relative;
@@ -1985,7 +1986,7 @@ insert_operand (unsigned insn,
 
       insn = (*operand->insert) (insn, val, &errmsg);
       if (errmsg)
-       as_warn (errmsg);
+       as_warn ("%s", errmsg);
     }
   else
     insn |= ((val & ((1 << operand->bits) - 1)) << operand->shift);
@@ -2060,7 +2061,7 @@ assemble_insn (const struct alpha_opcode *opcode,
 
        case O_constant:
          image = insert_operand (image, operand, t->X_add_number, NULL, 0);
-         assert (reloc_operand == NULL);
+         gas_assert (reloc_operand == NULL);
          reloc_operand = operand;
          reloc_exp = t;
          break;
@@ -2090,7 +2091,7 @@ assemble_insn (const struct alpha_opcode *opcode,
              if (reloc == BFD_RELOC_UNUSED)
                reloc = operand->default_reloc;
 
-             assert (reloc_operand == NULL);
+             gas_assert (reloc_operand == NULL);
              reloc_operand = operand;
              reloc_exp = t;
            }
@@ -2180,7 +2181,7 @@ emit_ir_load (const expressionS *tok,
 
   if (lituse)
     {
-      assert (insn.nfixups < MAX_INSN_FIXUPS);
+      gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
       insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
       insn.fixups[insn.nfixups].exp.X_op = O_absent;
       insn.nfixups++;
@@ -2229,7 +2230,7 @@ emit_loadstore (const expressionS *tok,
 
   if (lituse)
     {
-      assert (insn.nfixups < MAX_INSN_FIXUPS);
+      gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
       insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
       insn.fixups[insn.nfixups].exp.X_op = O_absent;
       insn.nfixups++;
@@ -2275,7 +2276,7 @@ emit_ldXu (const expressionS *tok,
 
       if (lituse)
        {
-         assert (insn.nfixups < MAX_INSN_FIXUPS);
+         gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
          insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
          insn.fixups[insn.nfixups].exp.X_op = O_absent;
          insn.nfixups++;
@@ -2291,7 +2292,7 @@ emit_ldXu (const expressionS *tok,
 
       if (lituse)
        {
-         assert (insn.nfixups < MAX_INSN_FIXUPS);
+         gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
          insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BYTOFF;
          insn.fixups[insn.nfixups].exp.X_op = O_absent;
          insn.nfixups++;
@@ -2427,7 +2428,7 @@ emit_stX (const expressionS *tok,
 
       if (lituse)
        {
-         assert (insn.nfixups < MAX_INSN_FIXUPS);
+         gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
          insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
          insn.fixups[insn.nfixups].exp.X_op = O_absent;
          insn.nfixups++;
@@ -2444,7 +2445,7 @@ emit_stX (const expressionS *tok,
 
       if (lituse)
        {
-         assert (insn.nfixups < MAX_INSN_FIXUPS);
+         gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
          insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BYTOFF;
          insn.fixups[insn.nfixups].exp.X_op = O_absent;
          insn.nfixups++;
@@ -2460,7 +2461,7 @@ emit_stX (const expressionS *tok,
 
       if (lituse)
        {
-         assert (insn.nfixups < MAX_INSN_FIXUPS);
+         gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
          insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BYTOFF;
          insn.fixups[insn.nfixups].exp.X_op = O_absent;
          insn.nfixups++;
@@ -2480,7 +2481,7 @@ emit_stX (const expressionS *tok,
 
       if (lituse)
        {
-         assert (insn.nfixups < MAX_INSN_FIXUPS);
+         gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
          insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_BASE;
          insn.fixups[insn.nfixups].exp.X_op = O_absent;
          insn.nfixups++;
@@ -2845,7 +2846,7 @@ emit_jsrjmp (const expressionS *tok,
 
   if (lituse)
     {
-      assert (insn.nfixups < MAX_INSN_FIXUPS);
+      gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
       insn.fixups[insn.nfixups].reloc = DUMMY_RELOC_LITUSE_JSR;
       insn.fixups[insn.nfixups].exp.X_op = O_absent;
       insn.nfixups++;
@@ -2866,7 +2867,7 @@ emit_jsrjmp (const expressionS *tok,
       memcpy (ensymname, symname, symlen);
       memcpy (ensymname + symlen, "..en", 5);
 
-      assert (insn.nfixups < MAX_INSN_FIXUPS);
+      gas_assert (insn.nfixups < MAX_INSN_FIXUPS);
       if (insn.nfixups > 0)
        {
          memmove (&insn.fixups[1], &insn.fixups[0],
@@ -3602,7 +3603,7 @@ s_alpha_comm (int ignore ATTRIBUTE_UNUSED)
   if (S_GET_VALUE (symbolP))
     {
       if (S_GET_VALUE (symbolP) != (valueT) size)
-        as_bad ("Length of .comm \"%s\" is already %ld. Not changed to %ld.",
+        as_bad (_("Length of .comm \"%s\" is already %ld. Not changed to %ld."),
                 S_GET_NAME (symbolP),
                 (long) S_GET_VALUE (symbolP),
                 (long) size);
@@ -4008,7 +4009,7 @@ s_alpha_coff_wrapper (int which)
     ecoff_directive_val,
   };
 
-  assert (which >= 0 && which < (int) (sizeof (fns)/sizeof (*fns)));
+  gas_assert (which >= 0 && which < (int) (sizeof (fns)/sizeof (*fns)));
 
   if (ECOFF_DEBUGGING)
     (*fns[which]) (0);
@@ -5120,7 +5121,7 @@ s_alpha_arch (int ignored ATTRIBUTE_UNUSED)
        alpha_target_name = p->name, alpha_target = p->flags;
        goto found;
       }
-  as_warn ("Unknown CPU identifier `%s'", name);
+  as_warn (_("Unknown CPU identifier `%s'"), name);
 
 found:
   *input_line_pointer = ch;
@@ -5294,7 +5295,7 @@ maybe_set_gp (asection *sec)
 static void
 select_gp_value (void)
 {
-  assert (alpha_gp_value == 0);
+  gas_assert (alpha_gp_value == 0);
 
   /* Get minus-one in whatever width...  */
   alpha_gp_value = 0;
@@ -5401,7 +5402,7 @@ md_begin (void)
     expressionS e;
 
     e.X_op = O_max;
-    assert (e.X_op == O_max);
+    gas_assert (e.X_op == O_max);
   }
 
   /* Create the opcode hash table.  */
@@ -5782,7 +5783,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg)
 
 #ifdef OBJ_ECOFF
     case BFD_RELOC_GPREL32:
-      assert (fixP->fx_subsy == alpha_gp_symbol);
+      gas_assert (fixP->fx_subsy == alpha_gp_symbol);
       fixP->fx_subsy = 0;
       /* FIXME: inherited this obliviousness of `value' -- why?  */
       md_number_to_chars (fixpos, -alpha_gp_value, 4);
@@ -5928,7 +5929,7 @@ md_apply_fix (fixS *fixP, valueT * valP, segT seg)
          as_fatal (_("unhandled relocation type %s"),
                    bfd_get_reloc_code_name (fixP->fx_r_type));
 
-       assert (-(int) fixP->fx_r_type < (int) alpha_num_operands);
+       gas_assert (-(int) fixP->fx_r_type < (int) alpha_num_operands);
        operand = &alpha_operands[-(int) fixP->fx_r_type];
 
        /* The rest of these fixups only exist internally during symbol
@@ -6213,7 +6214,7 @@ tc_gen_reloc (asection *sec ATTRIBUTE_UNUSED,
 
   /* Make sure none of our internal relocations make it this far.
      They'd better have been fully resolved by this point.  */
-  assert ((int) fixp->fx_r_type > 0);
+  gas_assert ((int) fixp->fx_r_type > 0);
 
   reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type);
   if (reloc->howto == NULL)
@@ -6228,7 +6229,7 @@ tc_gen_reloc (asection *sec ATTRIBUTE_UNUSED,
     as_fatal (_("internal error? cannot generate `%s' relocation"),
              bfd_get_reloc_code_name (fixp->fx_r_type));
 
-  assert (!fixp->fx_pcrel == !reloc->howto->pc_relative);
+  gas_assert (!fixp->fx_pcrel == !reloc->howto->pc_relative);
 
 #ifdef OBJ_ECOFF
   if (fixp->fx_r_type == BFD_RELOC_ALPHA_LITERAL)
This page took 0.088181 seconds and 4 git commands to generate.