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]

Re: binutils-doc 2.15-5: glitches in ld.info


> 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.


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