This is the mail archive of the binutils@sourceware.org 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]

forward references in equates


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


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