static void cris_relax_reg_prefix PARAMS ((void));
static void cris_sym_leading_underscore PARAMS ((void));
static void cris_sym_no_leading_underscore PARAMS ((void));
+static char *cris_insn_first_word_frag PARAMS ((void));
/* Handle to the opcode hash table. */
static struct hash_control *op_hash = NULL;
}
}
+/* Allocate space for the first piece of an insn, and mark it as the
+ start of the insn for debug-format use. */
+
+static char *
+cris_insn_first_word_frag ()
+{
+ char *insnp = frag_more (2);
+
+ /* We need to mark the start of the insn by passing dwarf2_emit_insn
+ the offset from the current fragment position. This must be done
+ after the first fragment is created but before any other fragments
+ (fixed or varying) are created. Note that the offset only
+ corresponds to the "size" of the insn for a fixed-size,
+ non-expanded insn. */
+ if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
+ dwarf2_emit_insn (2);
+
+ return insnp;
+}
+
/* Port-specific assembler initialization. */
void
struct cris_prefix prefix;
char *opcodep;
char *p;
- int insn_size = 0;
know (str);
case PREFIX_BDAP:
case PREFIX_BIAP:
case PREFIX_DIP:
- insn_size += 2;
- opcodep = frag_more (2);
+ opcodep = cris_insn_first_word_frag ();
/* Output the prefix opcode. */
md_number_to_chars (opcodep, (long) prefix.opcode, 2);
= (prefix.kind == PREFIX_DIP
? 4 : cris_get_pic_reloc_size (prefix.reloc));
- insn_size += relocsize;
p = frag_more (relocsize);
fix_new_exp (frag_now, (p - frag_now->fr_literal), relocsize,
&prefix.expr, 0, prefix.reloc);
break;
case PREFIX_PUSH:
- insn_size += 2;
- opcodep = frag_more (2);
+ opcodep = cris_insn_first_word_frag ();
/* Output the prefix opcode. Being a "push", we add the negative
size of the register to "sp". */
return;
/* Done with the prefix. Continue with the main instruction. */
- insn_size += 2;
- opcodep = frag_more (2);
+ if (prefix.kind == PREFIX_NONE)
+ opcodep = cris_insn_first_word_frag ();
+ else
+ opcodep = frag_more (2);
/* Output the instruction opcode. */
md_number_to_chars (opcodep, (long) (output_instruction.opcode), 2);
branch. */
char *cond_jump = frag_more (10);
- insn_size += 10;
gen_cond_branch_32 (opcodep, cond_jump, frag_now,
output_instruction.expr.X_add_symbol,
(symbolS *) NULL,
BAD_CASE (output_instruction.imm_oprnd_size);
}
- insn_size += output_instruction.imm_oprnd_size;
p = frag_more (output_instruction.imm_oprnd_size);
fix_new_exp (frag_now, (p - frag_now->fr_literal),
output_instruction.imm_oprnd_size,
output_instruction.reloc);
}
}
-
- if (OUTPUT_FLAVOR == bfd_target_elf_flavour)
- dwarf2_emit_insn (insn_size);
}
/* Low level text-to-bits assembly. */
/* Put out the prefix opcode; assume quick immediate mode at first. */
opcode = BDAP_QUICK_OPCODE | (base_regno << 12);
- opcodep = frag_more (2);
+ opcodep = cris_insn_first_word_frag ();
md_number_to_chars (opcodep, opcode, 2);
if (exprP->X_op == O_constant)
the bfd is already created. */
if (symbols_have_leading_underscore == false)
- as_bad (".syntax %s requires command-line option `--underscore'",
+ as_bad (_(".syntax %s requires command-line option `--underscore'"),
SYNTAX_USER_SYM_LEADING_UNDERSCORE);
}
static void cris_sym_no_leading_underscore ()
{
if (symbols_have_leading_underscore == true)
- as_bad (".syntax %s requires command-line option `--no-underscore'",
+ as_bad (_(".syntax %s requires command-line option `--no-underscore'"),
SYNTAX_USER_SYM_NO_LEADING_UNDERSCORE);
}
int dummy;
{
if (OUTPUT_FLAVOR != bfd_target_elf_flavour)
- as_bad ("Pseudodirective .file is only valid when generating ELF");
+ as_bad (_("Pseudodirective .file is only valid when generating ELF"));
else
dwarf2_directive_file (dummy);
}
int dummy;
{
if (OUTPUT_FLAVOR != bfd_target_elf_flavour)
- as_bad ("Pseudodirective .loc is only valid when generating ELF");
+ as_bad (_("Pseudodirective .loc is only valid when generating ELF"));
else
dwarf2_directive_loc (dummy);
}