diff options
author | Nick Clifton <nickc@redhat.com> | 2015-09-08 09:36:02 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2015-09-08 09:36:02 +0100 |
commit | 5707d2add464b6787ec615825e00b2407ba8a82b (patch) | |
tree | 8d9a72f11233b78d91e824d8f8bcc81bc93c20ba /ld | |
parent | 4e0753f6a572117e6197ebb6ceb163d4062ecde8 (diff) | |
download | gdb-5707d2add464b6787ec615825e00b2407ba8a82b.zip gdb-5707d2add464b6787ec615825e00b2407ba8a82b.tar.gz gdb-5707d2add464b6787ec615825e00b2407ba8a82b.tar.bz2 |
Extend the descriptiopn of how to access linker defined symbols from C.
* ld.texinfo (Source Code Reference): Extend description to
include an example using arrays.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 5 | ||||
-rw-r--r-- | ld/ld.texinfo | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index a9eb7c8..3ab9f75 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2015-09-08 Nick Clifton <nickc@redhat.com> + + * ld.texinfo (Source Code Reference): Extend description to + include an example using arrays. + 2015-07-28 Andrew Burgess <andrew.burgess@embecosm.com> * ld.h (enum orphan_handling_enum): New. diff --git a/ld/ld.texinfo b/ld/ld.texinfo index d20a59f..be1d490 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -3887,6 +3887,19 @@ Then the C source code to perform the copy would be: @end smallexample Note the use of the @samp{&} operators. These are correct. +Alternatively the symbols can be treated as the names of vectors or +arrays and then the code will again work as expected: + +@smallexample +@group + extern char start_of_ROM[], end_of_ROM[], start_of_FLASH[]; + + memcpy (start_of_FLASH, start_of_ROM, end_of_ROM - start_of_ROM); +@end group +@end smallexample + +Note how using this method does not require the use of @samp{&} +operators. @node SECTIONS @section SECTIONS Command |