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/ldgram.y | |
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/ldgram.y')
-rw-r--r-- | ld/ldgram.y | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y index a664258..9973b07 100644 --- a/ld/ldgram.y +++ b/ld/ldgram.y @@ -141,7 +141,7 @@ static int error_index; %token DEFINED TARGET_K SEARCH_DIR MAP ENTRY %token <integer> NEXT %token SIZEOF ALIGNOF ADDR LOADADDR MAX_K MIN_K -%token STARTUP HLL SYSLIB FLOAT NOFLOAT NOCROSSREFS +%token STARTUP HLL SYSLIB FLOAT NOFLOAT NOCROSSREFS NOCROSSREFS_TO %token ORIGIN FILL %token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS %token ALIGNMOD AT SUBALIGN HIDDEN PROVIDE PROVIDE_HIDDEN AS_NEEDED @@ -353,6 +353,10 @@ ifile_p1: { lang_add_nocrossref ($3); } + | NOCROSSREFS_TO '(' nocrossref_list ')' + { + lang_add_nocrossref_to ($3); + } | EXTERN '(' extern_name_list ')' | INSERT_K AFTER NAME { lang_add_insert ($3, 0); } |