Issues with the dot '.' symbol and the .fill directive

Dave Rager rageratwork@gmail.com
Fri Mar 16 14:19:00 GMT 2007


On 3/16/07, Alan Modra <amodra@bigpond.net.au> wrote:
> 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
>

Alan, Thanks. That makes sense. Probably explains why I didn't find
anything wrong with the code. :-)

Thanks again for the help!
Dave.



More information about the Binutils mailing list