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]

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


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


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