/* tc-arc.c -- Assembler for the ARC
Copyright 1994, 1995, 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
- 2006 Free Software Foundation, Inc.
+ 2006, 2007 Free Software Foundation, Inc.
Contributed by Doug Evans (dje@cygnus.com).
This file is part of GAS, the GNU Assembler.
GAS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
+ the Free Software Foundation; either version 3, or (at your option)
any later version.
GAS is distributed in the hope that it will be useful,
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
-#include <stdio.h>
-#include "libiberty.h"
#include "as.h"
#include "struc-symbol.h"
#include "safe-ctype.h"
target_big_endian = byte_order == BIG_ENDIAN;
if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, arc_mach_type))
- as_warn ("could not set architecture and machine");
+ as_warn (_("could not set architecture and machine"));
/* This call is necessary because we need to initialize `arc_operand_map'
which may be needed before we see the first insn. */
char *last;
if ((arc_suffix_hash = hash_new ()) == NULL)
- as_fatal ("virtual memory exhausted");
+ as_fatal (_("virtual memory exhausted"));
if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, mach))
- as_warn ("could not set architecture and machine");
+ as_warn (_("could not set architecture and machine"));
/* This initializes a few things in arc-opc.c that we need.
This must be called before the various arc_xxx_supported fns. */
if (*input_line_pointer != ',')
{
- as_bad ("expected comma after operand name");
+ as_bad (_("expected comma after operand name"));
ignore_rest_of_line ();
free (name);
return;
if (number < 0)
{
- as_bad ("negative operand number %d", number);
+ as_bad (_("negative operand number %d"), number);
ignore_rest_of_line ();
free (name);
return;
if (*input_line_pointer != ',')
{
- as_bad ("expected comma after register-number");
+ as_bad (_("expected comma after register-number"));
ignore_rest_of_line ();
free (name);
return;
{
if (strncmp (mode, "w", 1))
{
- as_bad ("invalid mode");
+ as_bad (_("invalid mode"));
ignore_rest_of_line ();
free (name);
return;
{
if (*input_line_pointer != ',')
{
- as_bad ("expected comma after register-mode");
+ as_bad (_("expected comma after register-mode"));
ignore_rest_of_line ();
free (name);
return;
{
if (strncmp (input_line_pointer, "can_shortcut", 12))
{
- as_bad ("shortcut designator invalid");
+ as_bad (_("shortcut designator invalid"));
ignore_rest_of_line ();
free (name);
return;
if ((opertype == 1) && number > 60)
{
- as_bad ("core register value (%d) too large", number);
+ as_bad (_("core register value (%d) too large"), number);
ignore_rest_of_line ();
free (name);
return;
if ((opertype == 0) && number > 31)
{
- as_bad ("condition code value (%d) too large", number);
+ as_bad (_("condition code value (%d) too large"), number);
ignore_rest_of_line ();
free (name);
return;
S_SET_VALUE (symbolP, (valueT) &ext_oper->operand);
else
{
- as_bad ("attempt to override symbol: %s", name);
+ as_bad (_("attempt to override symbol: %s"), name);
ignore_rest_of_line ();
free (name);
free (ext_oper);
strcpy (p, name);
break;
default:
- as_bad ("invalid opertype");
+ as_bad (_("invalid opertype"));
ignore_rest_of_line ();
free (name);
return;
if (*input_line_pointer != ',')
{
- as_bad ("expected comma after operand name");
+ as_bad (_("expected comma after operand name"));
ignore_rest_of_line ();
return;
}
if (*input_line_pointer != ',')
{
- as_bad ("expected comma after opcode");
+ as_bad (_("expected comma after opcode"));
ignore_rest_of_line ();
return;
}
if (subopcode < 0)
{
- as_bad ("negative subopcode %d", subopcode);
+ as_bad (_("negative subopcode %d"), subopcode);
ignore_rest_of_line ();
return;
}
{
if (3 != opcode)
{
- as_bad ("subcode value found when opcode not equal 0x03");
+ as_bad (_("subcode value found when opcode not equal 0x03"));
ignore_rest_of_line ();
return;
}
{
if (subopcode < 0x09 || subopcode == 0x3f)
{
- as_bad ("invalid subopcode %d", subopcode);
+ as_bad (_("invalid subopcode %d"), subopcode);
ignore_rest_of_line ();
return;
}
if (*input_line_pointer != ',')
{
- as_bad ("expected comma after subopcode");
+ as_bad (_("expected comma after subopcode"));
ignore_rest_of_line ();
return;
}
if (-1 == suffixcode)
{
- as_bad ("invalid suffix class");
+ as_bad (_("invalid suffix class"));
ignore_rest_of_line ();
return;
}
if (*input_line_pointer != ',')
{
- as_bad ("expected comma after suffix class");
+ as_bad (_("expected comma after suffix class"));
ignore_rest_of_line ();
return;
}
if (0 == (SYNTAX_VALID & class))
{
- as_bad ("invalid syntax class");
+ as_bad (_("invalid syntax class"));
ignore_rest_of_line ();
return;
}
if ((0x3 == opcode) & (class & SYNTAX_3OP))
{
- as_bad ("opcode 0x3 and SYNTAX_3OP invalid");
+ as_bad (_("opcode 0x3 and SYNTAX_3OP invalid"));
ignore_rest_of_line ();
return;
}
strcat (syntax, " ");
break;
default:
- as_bad ("unknown suffix class");
+ as_bad (_("unknown suffix class"));
ignore_rest_of_line ();
return;
break;
if (*input_line_pointer != ',')
{
- as_bad ("expected comma after symbol name");
+ as_bad (_("expected comma after symbol name"));
ignore_rest_of_line ();
return;
}
if (size < 0)
{
- as_bad ("negative symbol length");
+ as_bad (_("negative symbol length"));
ignore_rest_of_line ();
return;
}
if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP))
{
- as_bad ("ignoring attempt to re-define symbol");
+ as_bad (_("ignoring attempt to re-define symbol"));
ignore_rest_of_line ();
return;
}
if (((int) S_GET_VALUE (symbolP) != 0) \
&& ((int) S_GET_VALUE (symbolP) != size))
{
- as_warn ("length of symbol \"%s\" already %ld, ignoring %d",
+ as_warn (_("length of symbol \"%s\" already %ld, ignoring %d"),
S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size);
}
assert (symbolP->sy_frag == &zero_address_frag);
if (align < 0)
{
align = 0;
- as_warn ("assuming symbol alignment of zero");
+ as_warn (_("assuming symbol alignment of zero"));
}
}
else
/* If an instruction has already been seen, it's too late. */
if (cpu_tables_init_p)
{
- as_bad ("\".option\" directive must appear before any instructions");
+ as_bad (_("\".option\" directive must appear before any instructions"));
ignore_rest_of_line ();
return;
}
if (mach_type_specified_p && mach != arc_mach_type)
{
- as_bad ("\".option\" directive conflicts with initial definition");
+ as_bad (_("\".option\" directive conflicts with initial definition"));
ignore_rest_of_line ();
return;
}
{
/* The cpu may have been selected on the command line. */
if (mach != arc_mach_type)
- as_warn ("\".option\" directive overrides command-line (default) value");
+ as_warn (_("\".option\" directive overrides command-line (default) value"));
arc_mach_type = mach;
if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, mach))
- as_fatal ("could not set architecture and machine");
+ as_fatal (_("could not set architecture and machine"));
mach_type_specified_p = 1;
}
demand_empty_rest_of_line ();
return;
bad_cpu:
- as_bad ("invalid identifier for \".option\"");
+ as_bad (_("invalid identifier for \".option\""));
ignore_rest_of_line ();
}
\f
-/* Turn a string in input_line_pointer into a floating point constant
- of type TYPE, and store the appropriate bytes in *LITP. The number
- of LITTLENUMS emitted is stored in *SIZEP. An error message is
- returned, or NULL on OK. */
-
-/* Equal to MAX_PRECISION in atof-ieee.c */
-#define MAX_LITTLENUMS 6
-
char *
md_atof (int type, char *litP, int *sizeP)
{
- int prec;
- LITTLENUM_TYPE words[MAX_LITTLENUMS];
- LITTLENUM_TYPE *wordP;
- char *t;
-
- switch (type)
- {
- case 'f':
- case 'F':
- prec = 2;
- break;
-
- case 'd':
- case 'D':
- prec = 4;
- break;
-
- default:
- *sizeP = 0;
- return "bad call to md_atof";
- }
-
- t = atof_ieee (input_line_pointer, type, words);
- if (t)
- input_line_pointer = t;
- *sizeP = prec * sizeof (LITTLENUM_TYPE);
- for (wordP = words; prec--;)
- {
- md_number_to_chars (litP, (valueT) (*wordP++), sizeof (LITTLENUM_TYPE));
- litP += sizeof (LITTLENUM_TYPE);
- }
-
- return NULL;
+ return ieee_md_atof (type, litP, sizeP, TRUE);
}
/* Write a value out to the object file, using the appropriate
md_estimate_size_before_relax (fragS *fragp ATTRIBUTE_UNUSED,
asection *seg ATTRIBUTE_UNUSED)
{
- as_fatal (_("md_estimate_size_before_relax\n"));
+ as_fatal (_("relaxation not supported\n"));
return 1;
}
asection *sec ATTRIBUTE_UNUSED,
fragS *fragp ATTRIBUTE_UNUSED)
{
- as_fatal (_("md_convert_frag\n"));
+ abort ();
}
static void
expressionP->X_op_symbol = make_expr_symbol (&two);
}
else
- as_bad ("expression too complex code symbol");
+ as_bad (_("expression too complex code symbol"));
}
/* Parse an operand that is machine-specific.
expression (expressionP);
if (*input_line_pointer != ')')
{
- as_bad ("missing ')' in %%-op");
+ as_bad (_("missing ')' in %%-op"));
return;
}
++input_line_pointer;
else
{
as_bad_where (fixP->fx_file, fixP->fx_line,
- "unresolved expression that must be resolved");
+ _("unresolved expression that must be resolved"));
fixP->fx_done = 1;
return;
}
if (reloc->howto == (reloc_howto_type *) NULL)
{
as_bad_where (fixP->fx_file, fixP->fx_line,
- "internal error: can't export reloc type %d (`%s')",
+ _("internal error: can't export reloc type %d (`%s')"),
fixP->fx_r_type,
bfd_get_reloc_code_name (fixP->fx_r_type));
return NULL;
}
operand = arc_operands + arc_operand_map[(int) *syn];
if (operand->fmt == 0)
- as_fatal ("unknown syntax format character `%c'", *syn);
+ as_fatal (_("unknown syntax format character `%c'"), *syn);
if (operand->flags & ARC_OPERAND_FAKE)
{
else
{
if (num_suffixes == MAX_SUFFIXES)
- as_bad ("too many suffixes");
+ as_bad (_("too many suffixes"));
else
insn_suffixes[num_suffixes++] = suffix;
}
input_line_pointer = hold;
if (exp.X_op == O_illegal)
- as_bad ("illegal operand");
+ as_bad (_("illegal operand"));
else if (exp.X_op == O_absent)
- as_bad ("missing operand");
+ as_bad (_("missing operand"));
else if (exp.X_op == O_constant)
value = exp.X_add_number;
else if (exp.X_op == O_register)
reg = (struct arc_operand_value *) exp.X_add_number;
#define IS_REG_DEST_OPERAND(o) ((o) == 'a')
else if (IS_REG_DEST_OPERAND (*syn))
- as_bad ("symbol as destination register");
+ as_bad (_("symbol as destination register"));
else
{
if (!strncmp (str, "@h30", 4))
}
/* We need to generate a fixup for this expression. */
if (fc >= MAX_FIXUPS)
- as_fatal ("too many fixups");
+ as_fatal (_("too many fixups"));
fixups[fc].exp = exp;
/* We don't support shimm relocs. break here to force
the assembler to output a limm. */
++str;
if (!is_end_of_line[(unsigned char) *str])
- as_bad ("junk at end of line: `%s'", str);
+ as_bad (_("junk at end of line: `%s'"), str);
/* Is there a limm value? */
limm_p = arc_opcode_limm_p (&limm);
be legal, but let's warn the user anyway. Ditto for 8 byte
jumps with delay slots. */
if (in_delay_slot_p && limm_p)
- as_warn ("8 byte instruction in delay slot");
+ as_warn (_("8 byte instruction in delay slot"));
if (delay_slot_type != ARC_DELAY_NONE
&& limm_p && arc_insn_not_jl (insn)) /* except for jl addr */
- as_warn ("8 byte jump instruction with delay slot");
+ as_warn (_("8 byte jump instruction with delay slot"));
in_delay_slot_p = (delay_slot_type != ARC_DELAY_NONE) && !limm_p;
/* Warn when a conditional branch immediately follows a set of
insn that sets the condition codes uses a limm. */
if (cond_branch_p && conditional != 0 /* 0 = "always" */
&& prev_insn_needs_cc_nop_p && arc_mach_type == bfd_mach_arc_5)
- as_warn ("conditional branch follows set of flags");
+ as_warn (_("conditional branch follows set of flags"));
prev_insn_needs_cc_nop_p =
/* FIXME: ??? not required:
(delay_slot_type != ARC_DELAY_NONE) && */
}
if (NULL == last_errmsg)
- as_bad ("bad instruction `%s'", start);
+ as_bad (_("bad instruction `%s'"), start);
else
as_bad (last_errmsg);
}