gas macro handling broken in 2.16.91.0.1

Alan Modra amodra@bigpond.net.au
Tue Aug 23 06:20:00 GMT 2005


On Mon, Jun 27, 2005 at 01:12:14PM +0200, Olaf Hering wrote:
>  On Mon, Jun 27, Jan Beulich wrote:
> > This is caused by now scrubbing the output of a macro expansion
> > (http://sourceware.org/ml/binutils/2005-05/msg00561.html), which
> > results in macro arguments separated by spaces (rather than commas,
> > and in a macro expansion) where the first argument finishes with a
> > symbol and the second doesn't start with one to be concatenated. In
> > my opinion, the root cause here is the failure of tc-ppc.c to
> > include % in the symbol characters (hence % followed by a register
> > name isn't treated as a symbol, but rather as an operator followed
> > by a symbol); similar i386 code works well because % there
> > specifically is a symbol character. 

I'd say the root cause is the fact that the scrubber eats white space
completely, but fixing that requires checking that all targets will
strip a single space before each operand..

So for now, use the tc_symbol_chars hack.  I added '[' too, for PE
toc entry parsing.

	PR 1036
	* config/tc-ppc.c (ppc_symbol_chars): Add '%' and '['.

Index: gas/config/tc-ppc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.c,v
retrieving revision 1.105
diff -u -p -r1.105 tc-ppc.c
--- gas/config/tc-ppc.c	16 Aug 2005 03:17:53 -0000	1.105
+++ gas/config/tc-ppc.c	23 Aug 2005 05:58:02 -0000
@@ -184,8 +184,10 @@ const char EXP_CHARS[] = "eE";
 const char FLT_CHARS[] = "dD";
 
 /* '+' and '-' can be used as postfix predicate predictors for conditional
-   branches.  So they need to be accepted as symbol characters.  */
-const char ppc_symbol_chars[] = "+-";
+   branches.  So they need to be accepted as symbol characters.
+   Also, anything that can start an operand needs to be mentioned here,
+   to stop the input scrubber eating whitespace.  */
+const char ppc_symbol_chars[] = "+-%[";
 
 /* The dwarf2 data alignment, adjusted for 32 or 64 bit.  */
 int ppc_cie_data_alignment;

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre



More information about the Binutils mailing list