* ld-elf/orphan-region.d: Use ld -N.
[binutils-gdb.git] / ld / ldgram.y
index 1149e6b29c40cbe9db08c542a9fab873e016224f..49d9ff1bc3a658a6cb7ccc0c75ccbaa89984a120 100644 (file)
@@ -1,6 +1,7 @@
 /* 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, 2005, 2006, 2007 Free Software Foundation, Inc.
+   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+   Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
 
    This file is part of the GNU Binutils.
@@ -131,6 +132,7 @@ static int error_index;
 %token SEGMENT_START
 %token INCLUDE
 %token MEMORY
+%token REGION_ALIAS
 %token NOLOAD DSECT COPY INFO OVERLAY
 %token DEFINED TARGET_K SEARCH_DIR MAP ENTRY
 %token <integer> NEXT
@@ -352,6 +354,8 @@ ifile_p1:
                { lang_add_insert ($3, 0); }
        |       INSERT_K BEFORE NAME
                { lang_add_insert ($3, 1); }
+       |       REGION_ALIAS '(' NAME ',' NAME ')'
+               { lang_memory_region_alias ($3, $5); }
        ;
 
 input_list:
@@ -374,17 +378,17 @@ input_list:
                { lang_add_input_file($2,lang_input_file_is_l_enum,
                                 (char *)NULL); }
        |       AS_NEEDED '('
-                 { $<integer>$ = as_needed; as_needed = TRUE; }
+                 { $<integer>$ = add_DT_NEEDED_for_regular; add_DT_NEEDED_for_regular = TRUE; }
                     input_list ')'
-                 { as_needed = $<integer>3; }
+                 { add_DT_NEEDED_for_regular = $<integer>3; }
        |       input_list ',' AS_NEEDED '('
-                 { $<integer>$ = as_needed; as_needed = TRUE; }
+                 { $<integer>$ = add_DT_NEEDED_for_regular; add_DT_NEEDED_for_regular = TRUE; }
                     input_list ')'
-                 { as_needed = $<integer>5; }
+                 { add_DT_NEEDED_for_regular = $<integer>5; }
        |       input_list AS_NEEDED '('
-                 { $<integer>$ = as_needed; as_needed = TRUE; }
+                 { $<integer>$ = add_DT_NEEDED_for_regular; add_DT_NEEDED_for_regular = TRUE; }
                     input_list ')'
-                 { as_needed = $<integer>4; }
+                 { add_DT_NEEDED_for_regular = $<integer>4; }
        ;
 
 sections: