This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Issues with the dot '.' symbol and the .fill directive
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Dave Rager <rageratwork at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 16 Mar 2007 15:49:46 +1030
- Subject: Re: Issues with the dot '.' symbol and the .fill directive
- References: <93b2bf7a0703151453v254af0d2n3378547c8de9a1c5@mail.gmail.com>
On Thu, Mar 15, 2007 at 05:53:34PM -0400, Dave Rager wrote:
> .fill 4,1,0xff
> .long . # outputs a 4
Not exactly. It outputs a relocation too, <section start> + 4.
If you understand that, you'll see why the assembler is complaining
about "32 - ." not being absolute. "." is relative to the section
start, so any expression involving "." can't be absolute unless you
substract off another section relative value.
> #.fill 32 - 8,1,0 # works on all
> #.fill 32 - .,1,0 # works on 2.15, does not work on 2.16 or 2.17
Newer assemblers have better error checking. Rewrite your code as
a:
.fill 4,1,0xff
.long .
.fill 32 - (. - a)
--
Alan Modra
IBM OzLabs - Linux Technology Centre