/* Try to parse a reg name. Return the number of chars consumed. */
static unsigned int
-parse_reg_without_prefix (char *src, int *mode, int *reg)
+parse_reg_without_prefix (char *src, sh_arg_type *mode, int *reg)
{
char l0 = TOLOWER (src[0]);
char l1 = l0 ? TOLOWER (src[1]) : 0;
$-prefixed register names if enabled by the user. */
static unsigned int
-parse_reg (char *src, int *mode, int *reg)
+parse_reg (char *src, sh_arg_type *mode, int *reg)
{
unsigned int prefix;
unsigned int consumed;
parse_at (char *src, sh_operand_info *op)
{
int len;
- int mode;
+ sh_arg_type mode;
src++;
if (src[0] == '@')
{
get_operand (char **ptr, sh_operand_info *op)
{
char *src = *ptr;
- int mode = -1;
+ sh_arg_type mode = (sh_arg_type) -1;
unsigned int len;
if (src[0] == '#')
get_specific (sh_opcode_info *opcode, sh_operand_info *operands)
{
sh_opcode_info *this_try = opcode;
- char *name = opcode->name;
+ const char *name = opcode->name;
int n = 0;
while (opcode->name)
}
static void
-insert (char *where, int how, int pcrel, sh_operand_info *op)
+insert (char *where, bfd_reloc_code_real_type how, int pcrel,
+ sh_operand_info *op)
{
fix_new_exp (frag_now,
where - frag_now->fr_literal,
}
static void
-insert4 (char * where, int how, int pcrel, sh_operand_info * op)
+insert4 (char * where, bfd_reloc_code_real_type how, int pcrel,
+ sh_operand_info * op)
{
fix_new_exp (frag_now,
where - frag_now->fr_literal,
static char *
insert_loop_bounds (char *output, sh_operand_info *operand)
{
- char *name;
symbolS *end_sym;
/* Since the low byte of the opcode will be overwritten by the reloc, we
if (sh_relax)
{
static int count = 0;
+ char name[11];
/* If the last loop insn is a two-byte-insn, it is in danger of being
swapped with the insn after it. To prevent this, create a new
right in the middle, but four byte insns are not swapped anyways. */
/* A REPEAT takes 6 bytes. The SH has a 32 bit address space.
Hence a 9 digit number should be enough to count all REPEATs. */
- name = alloca (11);
sprintf (name, "_R%x", count++ & 0x3fffffff);
end_sym = symbol_new (name, undefined_section, 0, &zero_address_frag);
/* Make this a local symbol. */
break;
case IMM0_3s:
nbuf[indx] |= 0x08;
+ /* Fall through. */
case IMM0_3c:
insert (output + low_byte, BFD_RELOC_SH_IMM3, 0, operand);
break;
case IMM0_3Us:
nbuf[indx] |= 0x80;
+ /* Fall through. */
case IMM0_3Uc:
insert (output + low_byte, BFD_RELOC_SH_IMM3U, 0, operand);
break;
/* Various routines to kill one day. */
-char *
+const char *
md_atof (int type, char *litP, int *sizeP)
{
return ieee_md_atof (type, litP, sizeP, target_big_endian);
size_t md_longopts_size = sizeof (md_longopts);
int
-md_parse_option (int c, char *arg ATTRIBUTE_UNUSED)
+md_parse_option (int c, const char *arg ATTRIBUTE_UNUSED)
{
switch (c)
{
arelent *rel;
bfd_reloc_code_real_type r_type;
- rel = (arelent *) xmalloc (sizeof (arelent));
- rel->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *));
+ rel = XNEW (arelent);
+ rel->sym_ptr_ptr = XNEW (asymbol *);
*rel->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy);
rel->address = fixp->fx_frag->fr_address + fixp->fx_where;