This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Disallow SYM = EXPR in bfin gas
Jie Zhang wrote:
* config/tc-bfin.h (TC_EQUAL_IN_INSN): Redefine as 1.
(bfin_name_is_register): Remove declaration.
This bit was missed in my patch. Here is the new version contains it.
Jie
* config/bfin-defs.h (bfin_equals): Remove declaration.
* config/bfin-parse.y (asm_1): Remove "expr ASSIGN expr".
* config/tc-bfin.c (bfin_name_is_register): Remove.
(bfin_equals): Remove.
* config/tc-bfin.h (TC_EQUAL_IN_INSN): Redefine as 1.
(bfin_name_is_register): Remove declaration.
Index: config/bfin-defs.h
===================================================================
RCS file: /cvs/src/src/gas/config/bfin-defs.h,v
retrieving revision 1.3
diff -u -p -r1.3 bfin-defs.h
--- config/bfin-defs.h 26 Mar 2006 01:12:07 -0000 1.3
+++ config/bfin-defs.h 23 May 2006 04:20:09 -0000
@@ -374,7 +374,6 @@ void semantic_error_2 (char *syntax);
EXPR_T mkexpr (int, SYMBOL_T);
-extern void bfin_equals (Expr_Node *sym);
/* Defined in bfin-lex.l. */
void set_start_state (void);
Index: config/bfin-parse.y
===================================================================
RCS file: /cvs/src/src/gas/config/bfin-parse.y,v
retrieving revision 1.5
diff -u -p -r1.5 bfin-parse.y
--- config/bfin-parse.y 26 Mar 2006 01:12:07 -0000 1.5
+++ config/bfin-parse.y 23 May 2006 04:20:09 -0000
@@ -3223,16 +3223,6 @@ asm_1:
}
-
-/* Expression Assignment. */
-
- | expr ASSIGN expr
- {
- bfin_equals ($1);
- $$ = 0;
- }
-
-
/* PushPopMultiple. */
| reg_with_predec ASSIGN LPAREN REG COLON expr COMMA REG COLON expr RPAREN
{
Index: config/tc-bfin.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-bfin.c,v
retrieving revision 1.6
diff -u -p -r1.6 tc-bfin.c
--- config/tc-bfin.c 23 Apr 2006 22:12:43 -0000 1.6
+++ config/tc-bfin.c 23 May 2006 04:20:10 -0000
@@ -1969,42 +1969,6 @@ bfin_eol_in_insn (char *line)
}
bfd_boolean
-bfin_name_is_register (char *name)
-{
- int i;
-
- if (*name == '[' || *name == '(')
- return TRUE;
-
- if ((name[0] == 'W' || name[0] == 'w') && name[1] == '[')
- return TRUE;
-
- if ((name[0] == 'B' || name[0] == 'b') && name[1] == '[')
- return TRUE;
-
- for (i=0; bfin_reg_info[i].name != 0; i++)
- {
- if (!strcasecmp (bfin_reg_info[i].name, name))
- return TRUE;
- }
- return FALSE;
-}
-
-void
-bfin_equals (Expr_Node *sym)
-{
- char *c;
-
- c = input_line_pointer;
- while (*c != '=')
- c--;
-
- input_line_pointer = c;
-
- equals ((char *) sym->value.s_value, 1);
-}
-
-bfd_boolean
bfin_start_label (char *ptr)
{
ptr--;
Index: config/tc-bfin.h
===================================================================
RCS file: /cvs/src/src/gas/config/tc-bfin.h,v
retrieving revision 1.2
diff -u -p -r1.2 tc-bfin.h
--- config/tc-bfin.h 24 Oct 2005 18:35:59 -0000 1.2
+++ config/tc-bfin.h 23 May 2006 04:55:23 -0000
@@ -52,9 +52,9 @@ extern bfd_boolean bfin_start_label PARA
#define TC_EOL_IN_INSN(PTR) (bfin_eol_in_insn(PTR) ? 1 : 0)
extern bfd_boolean bfin_eol_in_insn PARAMS ((char *));
-/* The instruction is permitted to contain an = character. */
-#define TC_EQUAL_IN_INSN(C, NAME) (bfin_name_is_register (NAME) ? 1 : 0)
-extern bfd_boolean bfin_name_is_register PARAMS ((char *));
+/* Almost all instructions of Blackfin contain an = character. */
+#define TC_EQUAL_IN_INSN(C, NAME) 1
+
#define NOP_OPCODE 0x0000
#define LOCAL_LABELS_FB 1