+2009-07-01 Paul Brook <paul@codesourcery.com>
+
+ * config/tc-arm.c (MISSING_FNSTART): Define.
+ (s_arm_unwind_fnstart): Diagnose duplicate directive.
+ (s_arm_unwind_handlerdata, s_arm_unwind_fnend, s_arm_unwind_fnend,
+ s_arm_unwind_cantunwind, s_arm_unwind_personalityindex,
+ s_arm_unwind_personality, s_arm_unwind_save, s_arm_unwind_movsp,
+ s_arm_unwind_pad, s_arm_unwind_setfp, s_arm_unwind_raw): Error if
+ not inside function unwinding region.
+
2009-06-29 H.J. Lu <hongjiu.lu@intel.com>
* config/tc-i386.c: Reformat.
#define BAD_OUT_IT _("thumb conditional instruction should be in IT block")
#define BAD_IT_COND _("incorrect condition in IT block")
#define BAD_IT_IT _("IT falling in the range of a previous IT block")
+#define MISSING_FNSTART _("missing .fnstart before unwinding directive")
static struct hash_control *arm_ops_hsh;
static struct hash_control *arm_cond_hsh;
s_arm_unwind_fnstart (int ignored ATTRIBUTE_UNUSED)
{
demand_empty_rest_of_line ();
+ if (unwind.proc_start)
+ {
+ as_bad(_("duplicate .fnstart directive"));
+ return;
+ }
+
/* Mark the start of the function. */
unwind.proc_start = expr_build_dot ();
s_arm_unwind_handlerdata (int ignored ATTRIBUTE_UNUSED)
{
demand_empty_rest_of_line ();
+ if (!unwind.proc_start)
+ as_bad(MISSING_FNSTART);
+
if (unwind.table_entry)
as_bad (_("duplicate .handlerdata directive"));
demand_empty_rest_of_line ();
+ if (!unwind.proc_start)
+ {
+ as_bad(_(".fnend directive without .fnstart"));
+ return;
+ }
+
/* Add eh table entry. */
if (unwind.table_entry == NULL)
val = create_unwind_entry (0);
/* Restore the original section. */
subseg_set (unwind.saved_seg, unwind.saved_subseg);
+
+ unwind.proc_start = NULL;
}
s_arm_unwind_cantunwind (int ignored ATTRIBUTE_UNUSED)
{
demand_empty_rest_of_line ();
+ if (!unwind.proc_start)
+ as_bad(MISSING_FNSTART);
+
if (unwind.personality_routine || unwind.personality_index != -1)
as_bad (_("personality routine specified for cantunwind frame"));
{
expressionS exp;
+ if (!unwind.proc_start)
+ as_bad(MISSING_FNSTART);
+
if (unwind.personality_routine || unwind.personality_index != -1)
as_bad (_("duplicate .personalityindex directive"));
{
char *name, *p, c;
+ if (!unwind.proc_start)
+ as_bad(MISSING_FNSTART);
+
if (unwind.personality_routine || unwind.personality_index != -1)
as_bad (_("duplicate .personality directive"));
struct reg_entry *reg;
bfd_boolean had_brace = FALSE;
+ if (!unwind.proc_start)
+ as_bad(MISSING_FNSTART);
+
/* Figure out what sort of save we have. */
peek = input_line_pointer;
valueT op;
int offset;
+ if (!unwind.proc_start)
+ as_bad(MISSING_FNSTART);
+
reg = arm_reg_parse (&input_line_pointer, REG_TYPE_RN);
if (reg == FAIL)
{
{
int offset;
+ if (!unwind.proc_start)
+ as_bad(MISSING_FNSTART);
+
if (immediate_for_directive (&offset) == FAIL)
return;
int fp_reg;
int offset;
+ if (!unwind.proc_start)
+ as_bad(MISSING_FNSTART);
+
fp_reg = arm_reg_parse (&input_line_pointer, REG_TYPE_RN);
if (skip_past_comma (&input_line_pointer) == FAIL)
sp_reg = FAIL;
unsigned char op[16];
int count;
+ if (!unwind.proc_start)
+ as_bad(MISSING_FNSTART);
+
expression (&exp);
if (exp.X_op == O_constant
&& skip_past_comma (&input_line_pointer) != FAIL)