John David Anglin | 30 Nov 17:13
Picon

Re: [PATCH] hppa-linux-gas binutils patch

> deller <at> c3000:~/binutils/run/bin$ cat test.s
> AA       .equ  4
> BB      .equ  6
> deller <at> c3000:~/binutils/run/bin$ as test.s
> test.s: Assembler messages:
> test.s:1: Error: Unknown opcode: `aa'
> test.s:2: Error: Invalid operands

This is because the linux target was changed to require colons after
labels.  As a result, operands can start in the first column of a line.
Under hpux, there needs to be at least one white space character before
an operand and labels have to start in the first column.

> although as.info states:
> 
> 7.37 `.equ SYMBOL, EXPRESSION'
> ==============================
> 
> This directive sets the value of SYMBOL to EXPRESSION.  It is
> synonymous with `.set'; see *Note `.set': Set.
> 
>    The syntax for `equ' on the HPPA is `SYMBOL .equ EXPRESSION'.

This doesn't reflect that SYMBOL needs to be followed by a colon
on HPPA linux.  So, the documentation needs updating.

Probably, the linux should have been updated to use the normal GNU
syntax when it was introduced.  Now, updating the syntax involves a
potential compatibility break with GCC and existing assembler code.
At the moment, I don't see a strong need to do the update.
(Continue reading)

Helge Deller | 2 Dec 16:21
X-Face
Picon
Picon

Re: [PATCH] hppa-linux-gas binutils patch

On Thursday 30 November 2006 17:13, John David Anglin wrote:
> > deller <at> c3000:~/binutils/run/bin$ cat test.s
> > AA       .equ  4
> > BB      .equ  6
> > deller <at> c3000:~/binutils/run/bin$ as test.s
> > test.s: Assembler messages:
> > test.s:1: Error: Unknown opcode: `aa'
> > test.s:2: Error: Invalid operands
> 
> This is because the linux target was changed to require colons after
> labels.  ....

yes.

> > although as.info states:
> > 
> > 7.37 `.equ SYMBOL, EXPRESSION'
> > ==============================
> > 
> > This directive sets the value of SYMBOL to EXPRESSION.  It is
> > synonymous with `.set'; see *Note `.set': Set.
> > 
> >    The syntax for `equ' on the HPPA is `SYMBOL .equ EXPRESSION'.
> 
> This doesn't reflect that SYMBOL needs to be followed by a colon
> on HPPA linux.  So, the documentation needs updating.

yes.

> Probably, the linux should have been updated to use the normal GNU
(Continue reading)

John David Anglin | 2 Dec 22:13
Picon

Re: [PATCH] hppa-linux-gas binutils patch

> a)
> LABEL: 		.equ VALUE		; NOTE: LABEL with COLON ':'
> worked before on Linux, will still work. No idea about HPUX

It works on hpux.

> b)
> LABEL 		.equ VALUE		 ; NOTE: LABEL without COLON ':'
> never worked on Linux, and will still not work. 
> Standard on HPUX, so gnu as never followed HP-UX here.

This also works on hpux.  I don't understand your comment about
GNU as not following the behavior of HP as.  This is the only
variant allowed by HP as.

> c)
> 			.equ VAR,VALUE 
> standard gnu syntax. Didn't worked before on Linux. Will work now.
> HP-UX probably never allowed this one.

This isn't good enough.  Either it should work under hpux or be rejected.

> d)
> LABEL:		.equ VAR,VALUE
> never worked on Linux. Will still not work. Use eiter "LABEL:" or "VAR".
> HP-UX probably never allowed this one.

Probably, pa_equ should be updated to check that the rest of the line
is empty.  See s_set for an example.

(Continue reading)

Helge Deller | 10 Dec 18:15
X-Face
Picon
Picon

Re: [PATCH] hppa-linux-gas binutils patch

Hi Dave,

On Saturday 02 December 2006 22:13, John David Anglin wrote:
> > a)
> > LABEL: 		.equ VALUE		; NOTE: LABEL with COLON ':'
> > worked before on Linux, will still work. No idea about HPUX
> 
> It works on hpux.
> 
> > b)
> > LABEL 		.equ VALUE		 ; NOTE: LABEL without COLON ':'
> > never worked on Linux, and will still not work. 
> > Standard on HPUX, so gnu as never followed HP-UX here.
> 
> This also works on hpux.  I don't understand your comment about
> GNU as not following the behavior of HP as.  This is the only
> variant allowed by HP as.

I'm not sure why you didn't understood it... Maybe you just mis-read my comment ?
GNU as on Linux does _not_ accept this one, while HP as _accepts_ this syntax only.
So, GNU as and HP as differ in this one, and GNU as does not implement what HP as does.

> > c)
> > 			.equ VAR,VALUE 
> > standard gnu syntax. Didn't worked before on Linux. Will work now.
> > HP-UX probably never allowed this one.
> 
> This isn't good enough.  Either it should work under hpux or be rejected.

I think this is the culprit.
(Continue reading)

Carlos O'Donell | 2 Dec 17:50
Gravatar

Re: [PATCH] hppa-linux-gas binutils patch

Helge,

Thanks for the very clear and logical reasoning of new versus old features.
Also thanks for indulging me and cleaning up the documentation. I have a
poster on the wall that says "A bug is not closed until you document the
change." :)

One last request, write me a nice ChangeLog so I can give you credit for
the good work! After that I'll send it upstream.

Dave I hope Helge's email answers your questions?

Thanks.

> Index: config/tc-hppa.c
> ===================================================================
> RCS file: /cvs/src/src/gas/config/tc-hppa.c,v
> retrieving revision 1.133
> diff -u -r1.133 tc-hppa.c
> --- config/tc-hppa.c    30 Oct 2006 01:09:18 -0000      1.133
> +++ config/tc-hppa.c    2 Dec 2006 15:10:54 -0000
> @@ -3262,7 +3262,7 @@
>        return;
>      }
>
> -  /* Look up the opcode in the has table.  */
> +  /* Look up the opcode in the hash table.  */
>    if ((insn = (struct pa_opcode *) hash_find (op_hash, str)) == NULL)
>      {
>        as_bad ("Unknown opcode: `%s'", str);
(Continue reading)


Gmane