This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: bug in gas/read.c:s_space ?
From: Geoff Berry <geoffb@bops.com>
Date: Mon, 3 Apr 2000 18:35:13 -0400
It seems to me that the error checking in the included snippet of
s_space() is incorrect since the error is only reported if exp (which
is the size expression) is non-constant. This leads to weird behaivor
if someone mistakenly writes
.space 0x100, a
I don't see weird behaviour there. I see 256 bytes holding the value
of the symbol a, which is pretty much what I expect.
I would send a patch, but I don't really understand the intention of
the code in the else branch.
The code in the else branch handles the case of a simple fill value.
If the fill value can be expressed as a single signed byte, then the
space can be skipped using gas frag handling, which permits a
size which is only known at the end of the assembly. For a complex
fill value, gas insists on knowing the size at the time the .space
pseudo-op is seen.
Ian