aboutsummaryrefslogtreecommitdiff
path: root/ld/ldgram.y
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2007-05-24 09:24:09 +0000
committerNathan Sidwell <nathan@codesourcery.com>2007-05-24 09:24:09 +0000
commit8545d1a9dd556efc7950409426bd70d439fa43d8 (patch)
tree86699d55d009b454b4e0120f2e133efc39d55f09 /ld/ldgram.y
parent01be46b59d2e1078ccc0e69a3d5853b9d39a882b (diff)
downloadgdb-8545d1a9dd556efc7950409426bd70d439fa43d8.zip
gdb-8545d1a9dd556efc7950409426bd70d439fa43d8.tar.gz
gdb-8545d1a9dd556efc7950409426bd70d439fa43d8.tar.bz2
* ldlex.l: ASSERT is recognized in SCRIPT env. NAMES cannot
contain commas in EXP env. * ldgram.y (extern_name_list): Push to EXP env, move body to ... (extern_name_list_body): ... here. (script_file, ifile_list): Reformat. (statement): Add ASSERT. testsuite: * ld-scripts/assert.t: Add additional cases. * ld-scripts/extern.t, ld-scripts/extern.s, ld-scripts/extern.exp: New.
Diffstat (limited to 'ld/ldgram.y')
-rw-r--r--ld/ldgram.y27
1 files changed, 15 insertions, 12 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y
index 78d7165..b79fc6a 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -280,33 +280,33 @@ casesymlist:
| casesymlist ',' NAME
;
+/* Parsed as expressions so that commas separate entries */
extern_name_list:
+ { ldlex_expression (); }
+ extern_name_list_body
+ { ldlex_popstate (); }
+
+extern_name_list_body:
NAME
{ ldlang_add_undef ($1); }
- | extern_name_list NAME
+ | extern_name_list_body NAME
{ ldlang_add_undef ($2); }
- | extern_name_list ',' NAME
+ | extern_name_list_body ',' NAME
{ ldlang_add_undef ($3); }
;
script_file:
- {
- ldlex_both();
- }
- ifile_list
- {
- ldlex_popstate();
- }
+ { ldlex_both(); }
+ ifile_list
+ { ldlex_popstate(); }
;
-
ifile_list:
- ifile_list ifile_p1
+ ifile_list ifile_p1
|
;
-
ifile_p1:
memory
| sections
@@ -573,6 +573,9 @@ statement:
{
lang_add_fill ($3);
}
+ | ASSERT_K {ldlex_expression ();} '(' exp ',' NAME ')' end
+ { ldlex_popstate ();
+ lang_add_assignment (exp_assert ($4, $6)); }
;
statement_list: