forward references in equates

Jan Beulich JBeulich@novell.com
Wed Sep 14 17:53:00 GMT 2005


It seems like I'm running into a compatibility problem with gas vs.
other assemblers: Both MASM (x86/x86-64) and ias (ia64) allow constructs
similar to the following, namely with forward references in equates:

 .equiv two, 2*one
 .equ one, 1

 .data

 .if two > one
	.byte	one
	.byte	two
 .endif

 .equ one, -1
	.byte	one
	.byte	two

with the effect that
a) operands requiring absolute expressions don't get an error (i.e. in
the .if directive above)
b) both values used for the first pair of .byte directives get their
values computed from the original value of 'one', not the final one.

Realizing that changing this might break existing code I wonder whether
this should just be fixed (because current behavior doesn't make much
sense) or whether the old behavior should be retained and the new
behavior be setable via command line option and/or directive.

Thanks, Jan



More information about the Binutils mailing list