hppa-linux-gas binutils patch
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 3 lines
a)
LABEL: .equ VALUE ; NOTE: LABEL with COLON ':'
worked before on Linux, will still work. No idea about HPUX
It works on hpux.
Quoted 4 lines
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.
Quoted 4 lines
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.
Quoted 4 lines
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.
Review line 3268
Quoted 9 lines
(quoted diff) +1
-1@@ -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);
This typo fix should be a separate patch. It's fine with the addition of a ChangeLog entry.
Review line 6404
Quoted 11 lines
(quoted diff) +5
-2@@ -6397,8 +6397,11 @@ { if (reg) as_bad (_(".REG must use a label")); - else - as_bad (_(".EQU must use a label")); + else { + /* Try gas' standard ".equ X,Y" pseudo opcode. */ + s_set(0); + return; + }
I still have a problem with this part. It drops the ".EQU must use a label" error message and s_set has no equivalent error message. In order to support the alternative syntax, you need to parse the rest of the manner similar to that done in s_set. We need a message that handles both ".EQU must use a label" and "expected symbol name".
The other problem that I see is the dropping of the check on the expression value:
fudge_reg_expressions = 1; seg = expression (&exp); fudge_reg_expressions = 0; if (exp.X_op != O_constant && exp.X_op != O_register) ...
This is likely to be problematic under hpux. Even under linux, the two alternative forms don't handle equivalences in the same way. Compare what assign_symbol does compared with pa_equ.
It's certainly possible to do the checks described above. However, I have to wonder if it wouldn't be simpler to just do the following:
#if !(defined (OBJ_ELF) && (defined (TE_LINUX) || defined (TE_NetBSD)))
{"equ", pa_equ, 0},
#endif
This would yield the normal GNU syntax under linux and netbsd, and retain the existing syntax for other targets. This might cause some current code to fail but it's not a problem for GCC.
Review line 6407
Quoted 5 lines
(quoted diff) +2
-2@ifset HPPA -The syntax for @code{equ} on the HPPA is -@samp{@var{symbol} .equ @var{expression}}. +On HPPA the following syntax may be used alternatively: +@samp{@var{symbol:} .equ @var{expression}}
This also isn't quite right. See my comment to "b)". Symbol must be a label symbol.
Review
Quoted 6 lines
@ifset HPPA
(quoted diff) +2
-2-The syntax for @code{set} on the HPPA is -@samp{@var{symbol} .set @var{expression}}. +Alternatively the syntax for @code{set} on the HPPA is +@samp{@var{symbol:} .set @var{expression}}. @end ifset
Both the original and proposed change aren't right. There is no special handling for .set on HPPA (see md_pseudo_table). So, the HPPA bit can just be deleted.
In standard GNU syntax, .equ and .set are synonyms. Since .set has the standard behavior, it can be used instead of .equ. That's why I question modifying the syntax of .equ, but I will accept the change if it provides a behavior similar to the current behavior.
Dave
Signature · 2 lines
J. David Anglin [email protected] National Research Council of Canada (613) 990-0752 (FAX: 952-6602)