summaryrefslogtreecommitdiff
path: root/ld/ldgram.y
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2004-02-18 16:37:21 +0000
committerNathan Sidwell <nathan@codesourcery.com>2004-02-18 16:37:21 +0000
commitb6ca8815ef79f8fef380079e69b6984972a36f2a (patch)
tree5a71d2129472d86b22e1f42c512b9d598d7ea780 /ld/ldgram.y
parent34920d91a5b766acf1806063e3b8507c709d5d4f (diff)
downloadbinutils-gdb-b6ca8815ef79f8fef380079e69b6984972a36f2a.tar.gz
* ldgram.y (statement_anywhere): Add assert rule.
* ldlang.c (exp_init_os): Add assert case. * testsuite/ld-scripts/assert.{s,t,exp}: New.
Diffstat (limited to 'ld/ldgram.y')
-rw-r--r--ld/ldgram.y3
1 files changed, 3 insertions, 0 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y
index 927114a8a1c..e885f7d55fb 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -386,6 +386,9 @@ statement_anywhere:
ENTRY '(' NAME ')'
{ lang_add_entry ($3, FALSE); }
| assignment end
+ | ASSERT_K {ldlex_expression ();} '(' exp ',' NAME ')'
+ { ldlex_popstate ();
+ lang_add_assignment (exp_assert ($4, $6)); }
;
/* The '*' and '?' cases are there because the lexer returns them as