aboutsummaryrefslogtreecommitdiff
path: root/ld/ldgram.y
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-01-21 12:04:25 +0000
committerJakub Jelinek <jakub@redhat.com>2005-01-21 12:04:25 +0000
commitb717d30eb550a5418757c32f232a01e7620f640d (patch)
treefa15733535e0ec54103ecceed09a391130d34616 /ld/ldgram.y
parent666ec76f414cd10124107b16e44a5a3f4f63d69c (diff)
downloadgdb-b717d30eb550a5418757c32f232a01e7620f640d.zip
gdb-b717d30eb550a5418757c32f232a01e7620f640d.tar.gz
gdb-b717d30eb550a5418757c32f232a01e7620f640d.tar.bz2
* ldgram.y (AS_NEEDED): New token.
(input_list): Handle AS_NEEDED ( input_list ). * ldlex.l (AS_NEEDED): Add. * ld.texinfo: Document AS_NEEDED (). * NEWS: Mention AS_NEEDED ().
Diffstat (limited to 'ld/ldgram.y')
-rw-r--r--ld/ldgram.y16
1 files changed, 14 insertions, 2 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y
index 49f274d..23151d8 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -1,6 +1,6 @@
/* A YACC grammar to parse a superset of the AT&T linker scripting language.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
This file is part of GNU ld.
@@ -144,7 +144,7 @@ static int error_index;
%token STARTUP HLL SYSLIB FLOAT NOFLOAT NOCROSSREFS
%token ORIGIN FILL
%token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS
-%token ALIGNMOD AT SUBALIGN PROVIDE
+%token ALIGNMOD AT SUBALIGN PROVIDE AS_NEEDED
%type <token> assign_op atype attributes_opt sect_constraint
%type <name> filename
%token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
@@ -372,6 +372,18 @@ input_list:
| input_list LNAME
{ lang_add_input_file($2,lang_input_file_is_l_enum,
(char *)NULL); }
+ | AS_NEEDED '('
+ { $<integer>$ = as_needed; as_needed = TRUE; }
+ input_list ')'
+ { as_needed = $<integer>3; }
+ | input_list ',' AS_NEEDED '('
+ { $<integer>$ = as_needed; as_needed = TRUE; }
+ input_list ')'
+ { as_needed = $<integer>5; }
+ | input_list AS_NEEDED '('
+ { $<integer>$ = as_needed; as_needed = TRUE; }
+ input_list ')'
+ { as_needed = $<integer>4; }
;
sections: