This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gas macro handling broken in 2.16.91.0.1


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.

However (and that's why I included Zack here), it would seem to me that this sort of backward incompatibility shouldn't happen, and hence I would think that the above mentioned patch may need some additional adjustment (perhaps not removing spaces when scrubbing macro results). This space removal (even when applied to original source code) always seemed at least odd to me, especially in macro contexts (and without this change in behavior), where I occasionally saw vital whitespace being eaten (and had to work around that).

Jan

>>> Olaf Hering <olh@suse.de> 25.06.05 00:17:45 >>>

I get syntax errors with current mainline cvs, this worked with
binutils-2.16.90.0.3 

example from rpm4:

as --gdwarf2 -a32 -K PIC -mppc -many -V -Qy -o test.o test.s
GNU assembler version 2.16.91.0.1 (powerpc-suse-linux) using BFD version 2.16.91.0.1 20050622 (SuSE Linux)
test.s: Assembler messages:
test.s:99: Error: bad expression
test.s:99: Error: syntax error; found `



 .file "test.S"

 .text
 .macro sxrk rk src
 lwz %r24, 0(\src)
 .endm

 .macro etfs rk offset
 lwz %r28,\offset+ 0(\rk)
 .endm

 .macro esft rk offset
 .endm

 .macro elr rk
 lwz %r24, 0(\rk)
 .endm

 .macro eblock rk src label
 sxrk \rk \src

 etfs \rk 16
 esft \rk 32
 etfs \rk 48
 esft \rk 64
 etfs \rk 80
 esft \rk 96
 etfs \rk 112
 esft \rk 128
 etfs \rk 144

 lwz %r11,256(\rk)
 cmpwi %r11,10
 beq \label

 esft \rk 160
 etfs \rk 176

 cmpwi %r11,12
 beq \label

 esft \rk 192
 etfs \rk 208

\label:
 slwi %r11,%r11,4
 add \rk,\rk,%r11

 elr \rk
 .endm

 .macro dtfs rk offset
 lwz %r28,\offset+ 0(\rk)
 .endm

 .macro dsft rk offset
 lwz %r24,\offset+ 0(\rk)
 .endm

 .macro dlr rk
 lwz %r24, 0(\rk)
 .endm

 .macro dblock rk src label
 sxrk \rk \src

 dtfs \rk 16
 dsft \rk 32
 dtfs \rk 48
 dsft \rk 64
 dtfs \rk 80
 dsft \rk 96
 dtfs \rk 112
 dsft \rk 128
 dtfs \rk 144

 lwz %r11,256(\rk)
 cmpwi %r11,10
 beq \label

 dsft \rk 160
 dtfs \rk 176

 cmpwi %r11,12
 beq \label

 dsft \rk 192
 dtfs \rk 208

\label:
 slwi %r11,%r11,4
 add \rk,\rk,%r11

 dlr \rk
 .endm

.align 8; .global aesEncrypt
aesEncrypt:
 eblock rk=%r3 src=%r5 label=.L00
.LaesEncrypt_size: .size aesEncrypt, .LaesEncrypt_size - aesEncrypt;



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]