This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: binutils-doc 2.15-5: glitches in ld.info
- From: Edward Welbourne <eddy at opera dot com>
- To: nickc at redhat dot com
- Cc: ian at airs dot com, amodra at bigpond dot net dot au, binutils at sources dot redhat dot com
- Date: Tue, 01 Feb 2005 15:48:47 +0100
- Subject: Re: binutils-doc 2.15-5: glitches in ld.info
- References: <E1Crf48-0008TJ-00@whorl.oslo.opera.com> <20050123074306.GB18895@bubble.modra.org> <E1Ct1qD-0004l5-00@whorl.oslo.opera.com> <m3brbek5v7.fsf@gossamer.airs.com> <E1CtCyj-0000TM-00@whorl.oslo.opera.com> <41FF7985.4000807@redhat.com>
- Reply-to: eddy at opera dot com
> I have taken the liberty
> of rewriting it slightly, err, well actually rather a lot,
Good. I do not have delusions of expertise ...
Ah, that's how you write info files.
TeX with @ in place of \ ...
> What do you think of this version then ?
Looks good to me. A few comments below ...
Eddy.
--
+ contains the address of the block of memory holding the symbol's
+ value. So for example the C declaration:
+
+ @smallexample
+ int foo = 1000;
+ @end smallexample
needs to be clear about it being an extern decl; e.g. by phrasing it as
+ value. So for example (at file scope) the C declaration:
Subsequently:
+ Creates a entry called @samp{foo} in the symbol table. This entry
+ holds the address of an @samp{int} sized block of memory where the
+ number 1000 is currently stored.
initially <- ^^^^^^^^^
Later:
+ Linker scripts symbol declarations by contrast, create an entry in
+ the symbol table but do not assign any memory to them. Thus they are
+ an address without a value. So for example the linker script definition:
+
+ @smallexample
+ foo = 1000;
+ @end smallexample
+
+ Creates an entry in the symbol table called @samp{foo} which contains
+ the address of memory location 1000, but nothing special is stored at
+ address 1000. This means that you cannot access the @emph{value} of a
+ linker script defined symbol - it has no value - all you can do is
+ access the @emph{address} of a linker script defined symbol,
(i) punctuation: 2nd para begins mid-sentence, so "Creates" isn't
first word of a sentence and doesn't deserve to be capitalised; and this
para ends in a comma, "symbol," rather than "symbol."
(ii) but from a linker script's point of view the above is unfair, IIUC.
I would suggest
+ Linker scripts symbol declarations, by contrast, create an entry in
+ the symbol table but do not assign any memory to them. Thus they
+ name an address rather than the value recorded at an address. So for
+ example the linker script definition:
+
+ @smallexample
+ foo = 1000;
+ @end smallexample
+
+ creates an entry in the symbol table which gives name @samp{foo} to
+ memory location 1000, but stores nothing at address 1000 and provides
+ no means to alter @samp{foo} at run-time.
The subsequent paragraph's first sentence would then want re-phrased
something like
+ Hence when you reference a linker script defined symbol in source
+ code, the @emph{address} of the symbol, rather than its value, is
+ what the linker script has defined.