This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Using FILL(n) or =FILLEXP in linker scripts
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: Ti Strga <wearyofallthiscrap at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 10 Aug 2007 16:30:57 +0930
- Subject: Re: Using FILL(n) or =FILLEXP in linker scripts
- References: <52d7a73d0708091119n3d480b6bl9bacbc588f6dcbfb@mail.gmail.com>
On Thu, Aug 09, 2007 at 02:19:01PM -0400, Ti Strga wrote:
> .internal_chunk_two : {
> FILL(0xDEADBEEF) /* attempt one */
> __chunk_two_bottom = .;
> . = . + _CHUNK_TWO_SIZE;
> . = ALIGN(16);
> __chunk_two_top = .;
> } > ram =0xDEADBEEF /* attempt two */
>
> Neither FILL nor FILLEXP work here.
> Our questions:
> (1) What are we doing wrong with the fill expression?
The reason the fill isn't working is that ld treats this section like
a bss section. It doesn't have any input sections containing data,
nor does it have any data statements. You could argure that a
non-zero fill ought to force a normal section, ie. you've struck a ld
bug.
> (2) Shouldn't the line ". = . + _CHUNK_ONE_SIZE;" have moved the location
> counter forward in memory for the references in .internal_chunk_two?
No. You are using memory regions, with .internal_chunk_two belonging
to "ram". The ". = . + _CHUNK_ONE_SIZE;" is not inside an output
section statement, so this increases "dot" in the default memory
region. The value of "dot" in "ram" isn't changed.
--
Alan Modra
Australia Development Lab, IBM