* config/tc-z80.c (z80_start_line_hook): Fix parsing of 'equ' or
authorArnold Metselaar <arnold.metselaar@planet.nl>
Sun, 25 Oct 2009 16:15:19 +0000 (16:15 +0000)
committerArnold Metselaar <arnold.metselaar@planet.nl>
Sun, 25 Oct 2009 16:15:19 +0000 (16:15 +0000)
'defl' in cases where the space between the keyword and the
expression has been scrubbed away.
Do not check whether a symbol is redefined with 'equ' here;
the function equals takes an argument indicating whether
redefinitions are allowed.
Only call LISTING_NEWLINE if needed, and then after the call to
bump_line_counters.

gas/ChangeLog
gas/config/tc-z80.c

index c62d4f7..07888e7 100644 (file)
@@ -1,3 +1,14 @@
+2009-10-25  Arnold Metselaar  <arnold.metselaar@planet.nl>
+
+       * config/tc-z80.c (z80_start_line_hook): Fix parsing of 'equ' or
+       'defl' in cases where the space between the keyword and the
+       expression has been scrubbed away. 
+       Do not check whether a symbol is redefined with 'equ' here;
+       the function equals takes an argument indicating whether
+       redefinitions are allowed. 
+       Only call LISTING_NEWLINE if needed, and then after the call to
+       bump_line_counters. 
+       
 2009-10-25  Maciej W. Rozycki  <macro@linux-mips.org>
 
        * doc/as.texinfo (Overview): Move -mfix7000/-mno-fix7000 to
index d8bd59f..e2ea462 100644 (file)
@@ -253,10 +253,8 @@ z80_start_line_hook (void)
     {
       char c, *rest, *line_start;
       int len;
-      symbolS * symbolP;
 
       line_start = input_line_pointer;
-      LISTING_NEWLINE ();
       if (ignore_input ())
        return 0;
 
@@ -275,20 +273,17 @@ z80_start_line_hook (void)
        len = 4;
       else
        len = 0;
-      if (len && (rest[len] == ' ' || rest[len] == '\t'))
+      if (len && (!ISALPHA(rest[len]) ) )
        {
          /* Handle assignment here.  */
-         input_line_pointer = rest + len;
          if (line_start[-1] == '\n')
-           bump_line_counters ();
-         /* Most Z80 assemblers require the first definition of a
-             label to use "EQU" and redefinitions to have "DEFL".  */
-         if (len == 3 && (symbolP = symbol_find (line_start)) != NULL) 
            {
-             if (S_IS_DEFINED (symbolP) || symbol_equated_p (symbolP))
-               as_bad (_("symbol `%s' is already defined"), line_start);
+             bump_line_counters ();
+             LISTING_NEWLINE ();
            }
-         equals (line_start, 1);
+         input_line_pointer = rest + len - 1;
+         /* Allow redefining with "DEFL" (len == 4), but not with "EQU".  */
+         equals (line_start, len == 4);
          return 1;
        }
       else