This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Check for valid label
On Tue, Apr 22, 2003 at 06:07:42PM +0100, Nick Clifton wrote:
> Hi H.J.
>
> > On ia64, we can have
> >
> > (p7) hint @pause
> >
> > But gas won't take it:
> >
> > # as -o f.o f.s
> > f.s: Assembler messages:
> > f.s:1: Error: Unknown opcode `hint at pause'
> >
> > The problem is gas first treats "(p7)" as a label and then thinks it is
> > an opcode since it doesn't have a ":'. Later "hint @pause" is taken as
> > an operand and the white space before '@' gets removed. This patch
> > checks if the first char is a valid label char before treating it as
> > the start of a label.
>
> The patch is OK, (although it could make use of the IS_SYMBOL_COMPONENT
I checked in this patch.
> macro, and it ought to fix up the formatting of the comment as well),
> but it does not really solve the problem. Try assembling this source
> file:
>
> (p7) hint @pause
> ^
> |
> - note the space before the (p7)
I will look into it.
H.J.
---
2003-04-21 H.J. Lu <hjl at gnu dot org>
* app.c (do_scrub_chars): Check for valid label.
--- gas/app.c.label 2003-04-21 20:18:54.000000000 -0700
+++ gas/app.c 2003-04-22 10:32:10.000000000 -0700
@@ -1297,7 +1297,8 @@ do_scrub_chars (get, tostart, tolen)
/* Some relatively `normal' character. */
if (state == 0)
{
- state = 11; /* Now seeing label definition */
+ if (IS_SYMBOL_COMPONENT (ch))
+ state = 11; /* Now seeing label definition */
}
else if (state == 1)
{
@@ -1305,7 +1306,7 @@ do_scrub_chars (get, tostart, tolen)
}
else if (state == 9)
{
- if (lex[ch] != LEX_IS_SYMBOL_COMPONENT)
+ if (!IS_SYMBOL_COMPONENT (ch))
state = 3;
}
else if (state == 10)