From b717d30eb550a5418757c32f232a01e7620f640d Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 21 Jan 2005 12:04:25 +0000 Subject: * 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 (). --- ld/ldgram.y | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'ld/ldgram.y') 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 assign_op atype attributes_opt sect_constraint %type 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 '(' + { $$ = as_needed; as_needed = TRUE; } + input_list ')' + { as_needed = $3; } + | input_list ',' AS_NEEDED '(' + { $$ = as_needed; as_needed = TRUE; } + input_list ')' + { as_needed = $5; } + | input_list AS_NEEDED '(' + { $$ = as_needed; as_needed = TRUE; } + input_list ')' + { as_needed = $4; } ; sections: -- cgit v1.1