diff options
author | Nick Clifton <nickc@redhat.com> | 2005-05-17 14:35:21 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2005-05-17 14:35:21 +0000 |
commit | 3b83e13a450c5ecc419369bf0e413a895cb52608 (patch) | |
tree | 3d75763cf719ec8aadcd1cf7be88e91e0155ae17 /ld/ld.texinfo | |
parent | c3357c6410a943a30157dff506e9496061957750 (diff) | |
download | gdb-3b83e13a450c5ecc419369bf0e413a895cb52608.zip gdb-3b83e13a450c5ecc419369bf0e413a895cb52608.tar.gz gdb-3b83e13a450c5ecc419369bf0e413a895cb52608.tar.bz2 |
* ldlang.c (Scan_for_self_assignment): Check an assignment tree to
see if the same value is being used on the rhs as on the lhs.
(print_assignment): Call scan_for_self_assignment and if it
returns true, do no display the result of the computation but
instead just the final value of the symbol on the lhs.
* ld.texinfo: Document this behaviour and provide an example of
when it will happen.
Diffstat (limited to 'ld/ld.texinfo')
-rw-r--r-- | ld/ld.texinfo | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/ld/ld.texinfo b/ld/ld.texinfo index 7860e25..e66ec66 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -675,12 +675,40 @@ information about the link, including the following: @itemize @bullet @item -Where object files and symbols are mapped into memory. +Where object files are mapped into memory. @item How common symbols are allocated. @item All archive members included in the link, with a mention of the symbol which caused the archive member to be brought in. +@item +The values assigned to symbols. + +Note - symbols whose values are computed by an expression which +involves a reference to a previous value of the same symbol may not +have correct result displayed in the link map. This is because the +linker discards intermediate results and only retains the final value +of an expression. Under such circumstances the linker will display +the final value enclosed by square brackets. Thus for example a +linker script containing: + +@smallexample + foo = 1 + foo = foo * 4 + foo = foo + 8 +@end smallexample + +will produce the following output in the link map if the @option{-M} +option is used: + +@smallexample + 0x00000001 foo = 0x1 + [0x0000000c] foo = (foo * 0x4) + [0x0000000c] foo = (foo + 0x8) +@end smallexample + +See @ref{Expressions} for more information about expressions in linker +scripts. @end itemize @kindex -n |