Add new NOCROSSREFS_TO linker script command
authorMatthew Fortune <matthew.fortune@imgtec.com>
Thu, 14 Apr 2016 10:49:53 +0000 (11:49 +0100)
committerMatthew Fortune <matthew.fortune@imgtec.com>
Mon, 18 Apr 2016 11:45:46 +0000 (12:45 +0100)
commitcdf969539c718acb1f3f031b2c55d5274a538717
tree003ffa5726fcc2217dc4aafcdeb1efa46ff88b04
parent5947319ef398728052a22575e1d0de0e94e4220f
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.
13 files changed:
ld/ChangeLog
ld/NEWS
ld/ld.texinfo
ld/ldcref.c
ld/ldgram.y
ld/ldlang.c
ld/ldlang.h
ld/ldlex.l
ld/testsuite/ld-scripts/cross4.t [new file with mode: 0644]
ld/testsuite/ld-scripts/cross5.t [new file with mode: 0644]
ld/testsuite/ld-scripts/cross6.t [new file with mode: 0644]
ld/testsuite/ld-scripts/cross7.t [new file with mode: 0644]
ld/testsuite/ld-scripts/crossref.exp