This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Why no expressions in MEMORY command?
- From: Charles Manning <manningc2 at actrix dot gen dot nz>
- To: "Dave Korn" <dave dot korn at artimi dot com>,"'Alan Modra'" <amodra at bigpond dot net dot au>
- Cc: <binutils at sources dot redhat dot com>
- Date: Wed, 13 Apr 2005 09:46:42 +1200
- Subject: Re: Why no expressions in MEMORY command?
- References: <SERRANORmzeyNtqMk7L000000ef@SERRANO.CAM.ARTIMI.COM>
- Reply-to: manningc2 at actrix dot gen dot nz
> > Because no one has cared enough to write support to handle such symbols
> > in linker scripts.
Maybe I care enough to have a crack at this:-)
>
> FYI: I looked into it in some depth once; it would require quite a hefty
> bit of patching, since the information about symbol values isn't evaulated
> yet at the time the parser is reading the MEMORY command. See PR ld/518
> http://sourceware.org/bugzilla/show_bug.cgi?id=518, also see
> http://sources.redhat.com/ml/binutils/2004-03/msg00540.html
> for a detailed analysis, and
> http://sources.redhat.com/ml/binutils/2004-03/msg00571.html
> for a suggested solution.
Hmmm bummer. It seems to come down to there being no distinction between
expressions that can be evaluated before symbols are produced and others.
This makes the MEMORY stuff relatively limitied in its utility. There are
work arounds, but they are far from elegant.
-- Charles