char **str;
int shift;
{
+ static char buff [128]; /* XXX */
int reg;
char *start = *str;
if ((reg = arm_reg_parse (str)) != FAIL && int_register (reg))
{
- inst.instruction |= reg << shift;
+ if (shift >= 0)
+ inst.instruction |= reg << shift;
return reg;
}
+ /* Restore the start point, we may have got a reg of the wrong class. */
+ *str = start;
+
/* In the few cases where we might be able to accept something else
this error can be overridden */
- inst.error = _("Register expected");
+ sprintf (buff, _("Register expected, not '%.100s'"), start);
+ inst.error = buff;
- /* Restore the start point, we may have got a reg of the wrong class. */
- *str = start;
return FAIL;
}
p++;
if ((reg = reg_required_here (&p, 16)) == FAIL)
- {
- inst.error = _("Register required");
- return FAIL;
- }
+ return FAIL;
while (*p == ' ')
p++;
(*str)++; /* and fall through */
default:
if (reg_required_here (str, 0) == FAIL)
- {
- inst.error = _("Register expected");
- return FAIL;
- }
+ return FAIL;
if (hwse)
inst.instruction |= add;
str++;
if ((conflict_reg = reg_required_here (&str, 12)) == FAIL)
- {
- if (!inst.error)
- inst.error = bad_args;
- return;
- }
+ return;
if (skip_past_comma (&str) == FAIL)
{
str++;
if ((reg = reg_required_here (&str, 16)) == FAIL)
- {
- inst.error = _("Register required");
- return;
- }
+ return;
conflict_reg = (((conflict_reg == reg)
&& (inst.instruction & LOAD_BIT))
while (*str == ' ')
str++;
- if ((reg = arm_reg_parse (&str)) == FAIL || !int_register (reg))
- {
- inst.error = _("Register expected");
- return FAIL;
- }
-
+ if ((reg = reg_required_here (& str, -1)) == FAIL)
+ return FAIL;
+
if (in_range)
{
int i;
str++;
if ((base_reg = reg_required_here (&str, 16)) == FAIL)
- {
- if (!inst.error)
- inst.error = bad_args;
- return;
- }
+ return;
if (base_reg == REG_PC)
{
str++;
if ((reg = reg_required_here (&str, 16)) == FAIL)
- {
- inst.error = _("Register required");
- return;
- }
+ return;
while (*str == ' ')
str++;
str++;
if (reg_required_here (&str, 12) == FAIL)
- {
- if (! inst.error)
- inst.error = bad_args;
- return;
- }
+ return;
if (skip_past_comma (&str) == FAIL
|| fp_reg_required_here (&str, 0) == FAIL)
{
int reg;
- if ((reg = arm_reg_parse (strp)) == FAIL || ! int_register (reg))
- {
- inst.error = _("Register expected");
- return FAIL;
- }
+ if ((reg = reg_required_here (strp, -1)) == FAIL)
+ return FAIL;
switch (hi_lo)
{
/* Adjust the symbol table. This marks Thumb symbols as distinct from
ARM ones. */
+#ifdef OBJ_ELF
+#define S_GET_STORAGE_CLASS(S) (elf_symbol ((S)->bsym)->internal_elf_sym.st_other)
+#define S_SET_STORAGE_CLASS(S,V) (elf_symbol ((S)->bsym)->internal_elf_sym.st_other = (V))
+#endif
void
arm_adjust_symtab ()
{
-#if defined OBJ_COFF
+#if defined OBJ_COFF || defined OBJ_ELF
symbolS * sym;
for (sym = symbol_rootP; sym != NULL; sym = symbol_next (sym))
break;
}
}
-
+
+#ifdef OBJ_COFF
if (ARM_IS_INTERWORK (sym))
coffsymbol(sym->bsym)->native->u.syment.n_flags = 0xFF;
+#endif
}
#endif
}
+#ifdef OBJ_ELF
+void
+armelf_frob_symbol (symp, puntp)
+ symbolS *symp;
+ int *puntp;
+
+{
+ elf_frob_symbol (symp, puntp);
+
+ if (S_IS_EXTERNAL (symp))
+ S_SET_STORAGE_CLASS(symp, C_EXT);
+
+ if (S_GET_STORAGE_CLASS (symp) == C_NULL)
+ {
+ if (S_GET_SEGMENT (symp) == text_section
+ && symp != seg_info (text_section)->sym)
+ S_SET_STORAGE_CLASS (symp, C_LABEL);
+ else
+ S_SET_STORAGE_CLASS (symp, C_STAT);
+ }
+}
+#endif
int
arm_data_in_code ()
{