aboutsummaryrefslogtreecommitdiff
path: root/ld/ldgram.y
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1996-08-01 17:35:49 +0000
committerIan Lance Taylor <ian@airs.com>1996-08-01 17:35:49 +0000
commit582dd77f6571a3b9ca89d715d1522b68b2507feb (patch)
tree270378b4c50fe9c9e7c1b48dcbeb9cf7882213a7 /ld/ldgram.y
parent8efb80797cacf61ac0857cb9b149cac079356a3b (diff)
downloadgdb-582dd77f6571a3b9ca89d715d1522b68b2507feb.zip
gdb-582dd77f6571a3b9ca89d715d1522b68b2507feb.tar.gz
gdb-582dd77f6571a3b9ca89d715d1522b68b2507feb.tar.bz2
* ld.h (check_nocrossrefs): Declare.
* ldlang.h (struct lang_nocrossref): Define. (struct lang_nocrossrefs): Define. (nocrossref_list): Declare. (lang_add_nocrossref): Declare. * ldlex.l: Recognize NOCROSSREFS keyword. * ldgram.y (%union): Add nocrossref field. (NOCROSSREFS): New terminal. (ifile_p1): Recognize NOCROSSREFS. (nocrossref_list): New nonterminal. * ldlang.c (nocrossref_list): Define. (lang_add_nocrossref): New function. * ldmain.c (main): If nocrossref_list is not NULL, call check_nocrossrefs. (warning_callback): Free symbols if there is no place to store them. (notice): Call add_cref if nocrossref_list is not NULL. * ldcref.c: Include "ldexp.h" and "ldlang.h". (check_nocrossrefs): New function. (check_nocrossref): New static function. (struct check_refs_info): Define. (check_refs, check_reloc_refs): New static functions. * Makefile.in: Rebuild dependencies. * ld.texinfo (Option Commands): Document NOCROSSREFS.
Diffstat (limited to 'ld/ldgram.y')
-rw-r--r--ld/ldgram.y34
1 files changed, 32 insertions, 2 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y
index 92ba5bc..1f16baa 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -75,6 +75,7 @@ static int error_index;
union etree_union *at;
union etree_union *flags;
} phdr;
+ struct lang_nocrossref *nocrossref;
}
%type <etree> exp opt_exp_with_type mustbe_exp opt_at phdr_type phdr_val
@@ -82,8 +83,9 @@ static int error_index;
%type <name> memspec_opt casesymlist
%token <integer> INT
%token <name> NAME LNAME
-%type <integer> length
+%type <integer> length
%type <phdr> phdr_qualifiers
+%type <nocrossref> nocrossref_list
%right <token> PLUSEQ MINUSEQ MULTEQ DIVEQ '=' LSHIFTEQ RSHIFTEQ ANDEQ OREQ
%right <token> '?' ':'
@@ -112,7 +114,7 @@ static int error_index;
%token NOLOAD DSECT COPY INFO OVERLAY
%token NAME LNAME DEFINED TARGET_K SEARCH_DIR MAP ENTRY
%token <integer> SIZEOF NEXT ADDR
-%token STARTUP HLL SYSLIB FLOAT NOFLOAT
+%token STARTUP HLL SYSLIB FLOAT NOFLOAT NOCROSSREFS
%token ORIGIN FILL
%token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS
%token ALIGNMOD AT PROVIDE
@@ -299,6 +301,10 @@ ifile_p1:
{ lang_add_map($3); }
| INCLUDE filename
{ ldfile_open_command_file($2); } ifile_list END
+ | NOCROSSREFS '(' nocrossref_list ')'
+ {
+ lang_add_nocrossref ($3);
+ }
;
input_list:
@@ -569,6 +575,30 @@ floating_point_support:
{ lang_float(false); }
;
+nocrossref_list:
+ /* empty */
+ {
+ $$ = NULL;
+ }
+ | NAME nocrossref_list
+ {
+ struct lang_nocrossref *n;
+
+ n = (struct lang_nocrossref *) xmalloc (sizeof *n);
+ n->name = $1;
+ n->next = $2;
+ $$ = n;
+ }
+ | NAME ',' nocrossref_list
+ {
+ struct lang_nocrossref *n;
+
+ n = (struct lang_nocrossref *) xmalloc (sizeof *n);
+ n->name = $1;
+ n->next = $3;
+ $$ = n;
+ }
+ ;
mustbe_exp: { ldlex_expression(); }
exp