This is the mail archive of the binutils@sources.redhat.com 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]

MEMORY commands in link scripts


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



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