This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
MEMORY commands in link scripts
- From: "Jon Beniston" <jbeniston at compxs dot com>
- To: <binutils at sources dot redhat dot com>
- Date: Fri, 5 Nov 2004 11:59:15 -0000
- Subject: MEMORY commands in link scripts
- Organization: CompXs
- Reply-to: <jbeniston at compxs dot com>
Hi,
Is there any way to either use non-constants for the ORIGIN or LENGTH values
in a MEMORY command, or some how access these values else where in a link
script. What I would like to be able to do is, something like:
base = 0x100;
size = 0x100;
MEMORY {
ram (rw) : ORIGIN = base, LENGTH = size;
}
...
SECTIONS {
PROVIDE(_fstack = base + size - 4)
}
Or, alternatively:
SECTIONS {
PROVIDE(_fstack = ORIGIN(ram) + LENGTH(ram) - 4)
}
To put it another way, I would like to be able to override the size /
position of a memory from the command line.
Cheers,
Jon