This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: "defines" in linker script
- From: "Dave Korn" <dk at artimi dot com>
- To: "'binutils ML'" <binutils at sources dot redhat dot com>
- Date: Thu, 25 Mar 2004 15:44:48 -0000
- Subject: RE: "defines" in linker script
> -----Original Message-----
> From: binutils-owner On Behalf Of Massimiliano Cialdi
> Sent: 25 March 2004 15:35
> I want something like:
>
> VDIM = 2K;
>
> MEMORY
> {
> rom_vect : ORIGIN = 0x00000000, LENGTH = VDIM
> rom : ORIGIN = VDIM, LENGTH = 256K - VDIM
> ext_ram : ORIGIN = 0x00420000, LENGTH = 131072
> ram : ORIGIN = 0x00FFB000, LENGTH = 16320
> ram1 : ORIGIN = 0x00FFFFC0, LENGTH = 64
> }
Hey! So do I! I just posted the same thing yesterday!
> obviously this doesn't work. ld report
> "nonconstant expression for length"
It's supposed to work: the docs claim that you should be able to use any
expression that is well-defined before the memory allocation stage, which
your symbol looks like to me.
> So I wonder if there is something like #define in linker script.
What you've written is apparently meant to work. I believe it's a bug in
ld. See
http://sources.redhat.com/ml/binutils/2004-03/msg00540.html
for an in-depth analysis of exactly why it doesn't work; as to a solution,
I'm not very clear how to proceed.
cheers,
DaveK
--
Can't think of a witty .sigline today....