diff options
author | Matthew Fortune <matthew.fortune@imgtec.com> | 2016-04-14 11:49:53 +0100 |
---|---|---|
committer | Matthew Fortune <matthew.fortune@imgtec.com> | 2016-04-18 12:45:46 +0100 |
commit | cdf969539c718acb1f3f031b2c55d5274a538717 (patch) | |
tree | 003ffa5726fcc2217dc4aafcdeb1efa46ff88b04 /ld/ld.texinfo | |
parent | 5947319ef398728052a22575e1d0de0e94e4220f (diff) | |
download | gdb-cdf969539c718acb1f3f031b2c55d5274a538717.zip gdb-cdf969539c718acb1f3f031b2c55d5274a538717.tar.gz gdb-cdf969539c718acb1f3f031b2c55d5274a538717.tar.bz2 |
Add new NOCROSSREFS_TO linker script command
NOCROSSREFS_TO is similar to the existing NOCROSSREFS command but only
checks one direction of cross referencing.
ld/ChangeLog
* ld.texinfo: Document NOCROSSREFS_TO script command.
* ldlang.h (struct lang_nocrossrefs): Add onlyfirst field.
(lang_add_nocrossref_to): New prototype.
* ldcref.c (check_local_sym_xref): Use onlyfirst to only look for
symbols defined in the first section.
(check_nocrossref): Likewise.
* ldgram.y (NOCROSSREFS_TO): New script command.
* ldlang.c (lang_add_nocrossref): Set onlyfirst to FALSE.
(lang_add_nocrossref_to): New function.
* ldlex.l (NOCROSSREFS_TO): New token.
* NEWS: Mention NOCROSSREFS_TO.
* testsuite/ld-scripts/cross4.t: New file.
* testsuite/ld-scripts/cross5.t: Likewise.
* testsuite/ld-scripts/cross6.t: Likewise.
* testsuite/ld-scripts/cross7.t: Likewise.
* testsuite/ld-scripts/crossref.exp: Run 4 new NOCROSSREFS_TO
tests.
Diffstat (limited to 'ld/ld.texinfo')
-rw-r--r-- | ld/ld.texinfo | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/ld/ld.texinfo b/ld/ld.texinfo index d3d8dc6..7a2ed3a 100644 --- a/ld/ld.texinfo +++ b/ld/ld.texinfo @@ -3674,6 +3674,25 @@ an error and returns a non-zero exit status. Note that the @code{NOCROSSREFS} command uses output section names, not input section names. +@item NOCROSSREFS_TO(@var{tosection} @var{fromsection} @dots{}) +@kindex NOCROSSREFS_TO(@var{tosection} @var{fromsections}) +@cindex cross references +This command may be used to tell @command{ld} to issue an error about any +references to one section from a list of other sections. + +The @code{NOCROSSREFS} command is useful when ensuring that two or more +output sections are entirely independent but there are situations where +a one-way dependency is needed. For example, in a multi-core application +there may be shared code that can be called from each core but for safety +must never call back. + +The @code{NOCROSSREFS_TO} command takes a list of output section names. +The first section can not be referenced from any of the other sections. +If @command{ld} detects any references to the first section from any of +the other sections, it reports an error and returns a non-zero exit +status. Note that the @code{NOCROSSREFS_TO} command uses output section +names, not input section names. + @ifclear SingleFormat @item OUTPUT_ARCH(@var{bfdarch}) @kindex OUTPUT_ARCH(@var{bfdarch}) |