public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@bigpond.net.au>
To: Ti Strga <wearyofallthiscrap@gmail.com>
Cc: binutils@sourceware.org
Subject: Re: Using FILL(n) or =FILLEXP in linker scripts
Date: Fri, 10 Aug 2007 07:01:00 -0000	[thread overview]
Message-ID: <20070810070057.GL31829@bubble.grove.modra.org> (raw)
In-Reply-To: <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

  reply	other threads:[~2007-08-10  7:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-09 18:19 Ti Strga
2007-08-10  7:01 ` Alan Modra [this message]
2007-08-13 21:38   ` Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070810070057.GL31829@bubble.grove.modra.org \
    --to=amodra@bigpond.net.au \
    --cc=binutils@sourceware.org \
    --cc=wearyofallthiscrap@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).