bug in gas/read.c:s_space ?
Geoff Berry
geoffb@bops.com
Mon Apr 3 16:33:00 GMT 2000
The weird behavior I saw (on 2.9.4 i586-cygwin32) was an error message
saying BFD_RELOC_8 wasn't supported repeated N times (where N is the size
argument to the .space directive). This does tell me where the problem is
but isn't as helpful as an error message that said "Invalid non-constant
fill value" or something to that effect, though I understand that this isn't
possible if you want to allow .sets of `a' to occur after the .space.
Thanks to both you and Nick for the prompt reply.
-----Original Message-----
From: Ian Lance Taylor [ mailto:ian@zembu.com ]
Sent: Monday, April 03, 2000 6:58 PM
To: geoffb@bops.com
Cc: binutils@sourceware.cygnus.com
Subject: 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
More information about the Binutils
mailing list