This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Specifiying memory layout
- From: Ian Lance Taylor <ian at wasabisystems dot com>
- To: Shaun Jackman <sjackman at telus dot net>
- Cc: binutils at sources dot redhat dot com
- Date: 09 Jun 2004 16:33:52 -0400
- Subject: Re: Specifiying memory layout
- References: <200406091330.14686.sjackman@telus.net>
Shaun Jackman <sjackman@telus.net> writes:
> I'm linking an executable for an embedded system with 1 MB of memory
> starting at 0x02000000. I understand the following is the one line of
> a linker script that would have the desired effect.
>
> MEMORY { ram : ORIGIN = 0x02000000, LENGTH = 1024k }
>
> Can I use this line on it's own as a one line linker script? Should I
> tack this line onto the end of gcc's armelf.x and use the resulting
> linker script?
No. The memory regions will only be used for sections which are
specifically directed to be in those memory regions.
The quick way to do what you want is to copy the default linker script
and edit it to set the desired address at the first assignment to "."
in the SECTIONS command. You can find the default linker script at
something like /usr/local/TARGET/lib/ldscripts/NAME.x.
> If I can avoid using a linker script at all, that'd be good too! Can I
> specify these parameters on the command line?
Not really, unfortunately.
Ian