/* tc-xstormy16.c -- Assembler for the Sanyo XSTORMY16.
- Copyright 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation.
+ Copyright (C) 2000-2015 Free Software Foundation, Inc.
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,
You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to
- the Free Software Foundation, 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
+ the Free Software Foundation, 51 Franklin Street - Fifth Floor,
+ Boston, MA 02110-1301, USA. */
-#include <stdio.h>
#include "as.h"
#include "subsegs.h"
#include "symcat.h"
if (!insn.insn)
{
- as_bad (errmsg);
+ as_bad ("%s", errmsg);
return;
}
SKIP_WHITESPACE ();
if (*input_line_pointer != '(')
{
- as_bad ("Expected '('");
+ as_bad (_("Expected '('"));
goto err;
}
input_line_pointer++;
if (*input_line_pointer != ')')
{
- as_bad ("Missing ')'");
+ as_bad (_("Missing ')'"));
goto err;
}
input_line_pointer++;
SKIP_WHITESPACE ();
if (e->X_op != O_symbol)
- as_bad ("Not a symbolic expression");
+ as_bad (_("Not a symbolic expression"));
else if (* input_line_pointer == '-')
/* We are computing the difference of two function pointers
like this:
xstormy16_cons_fix_new (fragS *f,
int where,
int nbytes,
- expressionS *exp)
+ expressionS *exp,
+ bfd_reloc_code_real_type code)
{
- bfd_reloc_code_real_type code;
- fixS *fix;
-
if (exp->X_op == O_fptr_symbol)
{
switch (nbytes)
break;
default:
- as_bad ("unsupported fptr fixup size %d", nbytes);
+ as_bad (_("unsupported fptr fixup size %d"), nbytes);
return;
}
}
code = BFD_RELOC_32;
else
{
- as_bad ("unsupported fixup size %d", nbytes);
+ as_bad (_("unsupported fixup size %d"), nbytes);
return;
}
- fix = fix_new_exp (f, where, nbytes, exp, 0, code);
+ fix_new_exp (f, where, nbytes, exp, 0, code);
}
/* Called while parsing an instruction to create a fixup.
if (op == O_fptr_symbol)
{
if (operand->type != XSTORMY16_OPERAND_IMM16)
- as_bad ("unsupported fptr fixup");
+ as_bad (_("unsupported fptr fixup"));
else
{
fixP->fx_r_type = BFD_RELOC_XSTORMY16_FPTR16;
return TRUE;
}
-/* This is a copy of gas_cgen_md_apply_fix3, with some enhancements to
+/* This is a copy of gas_cgen_md_apply_fix, with some enhancements to
do various things that would not be valid for all ports. */
void
-xstormy16_md_apply_fix3 (fixS * fixP,
+xstormy16_md_apply_fix (fixS * fixP,
valueT * valueP,
segT seg ATTRIBUTE_UNUSED)
{
number_to_chars_littleendian (buf, val, n);
}
-/* 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;
-
- /* FIXME: Some targets allow other format chars for bigger sizes here. */
-
- 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);
-
- *sizeP = prec * sizeof (LITTLENUM_TYPE);
- /* This loops outputs the LITTLENUMs in REVERSE order; in accord with
- the littleendianness of the processor. */
- for (wordP = words + prec - 1; prec--;)
- {
- md_number_to_chars (litP, (valueT) (*wordP--), sizeof (LITTLENUM_TYPE));
- litP += sizeof (LITTLENUM_TYPE);
- }
-
- return 0;
+ return ieee_md_atof (type, litP, sizeP, FALSE);
}