Add support for -fdata-sections
[deliverable/binutils-gdb.git] / ld / ldgram.y
index 73ee4952f55c3237a5972b6288630d037f5d0709..2c4047897eafe493e4eb40e575956b539f16a346 100644 (file)
@@ -33,8 +33,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "ldexp.h"
 #include "ldver.h"
 #include "ldlang.h"
-#include "ldemul.h"
 #include "ldfile.h"
+#include "ldemul.h"
 #include "ldmisc.h"
 #include "ldmain.h"
 #include "mri.h"
@@ -92,6 +92,7 @@ static int error_index;
 %type <integer> fill_opt
 %type <name_list> exclude_name_list
 %type <name> memspec_opt casesymlist
+%type <name> memspec_at_opt
 %type <cname> wildcard_name
 %type <wildcard> wildcard_spec
 %token <integer> INT  
@@ -419,11 +420,11 @@ wildcard_spec:
 
 
 exclude_name_list:
-               exclude_name_list ',' wildcard_name
+               exclude_name_list wildcard_name
                        {
                          struct name_list *tmp;
                          tmp = (struct name_list *) xmalloc (sizeof *tmp);
-                         tmp->name = $3;
+                         tmp->name = $2;
                          tmp->next = $1;
                          $$ = tmp;     
                        }
@@ -618,7 +619,9 @@ memory_spec:                NAME
                attributes_opt ':'
                origin_spec opt_comma length_spec
 
-       ; origin_spec:
+       ;
+
+origin_spec:
        ORIGIN '=' mustbe_exp
                { region->current =
                 region->origin =
@@ -799,6 +802,11 @@ exp        :
        ;
 
 
+memspec_at_opt:
+                AT '>' NAME { $$ = $3; }
+        |       { $$ = "*default*"; }
+        ;
+
 opt_at:
                AT '(' exp ')' { $$ = $3; }
        |       { $$ = 0; }
@@ -815,10 +823,10 @@ section:  NAME            { ldlex_expression(); }
                        }
                statement_list_opt      
                '}' { ldlex_popstate (); ldlex_expression (); }
-               memspec_opt phdr_opt fill_opt
+               memspec_opt memspec_at_opt phdr_opt fill_opt
                {
                  ldlex_popstate ();
-                 lang_leave_output_section_statement ($13, $11, $12);
+                 lang_leave_output_section_statement ($14, $11, $13, $12);
                }
                opt_comma
        |       OVERLAY
@@ -832,10 +840,10 @@ section:  NAME            { ldlex_expression(); }
                overlay_section
                '}'
                        { ldlex_popstate (); ldlex_expression (); }
-               memspec_opt phdr_opt fill_opt
+               memspec_opt memspec_at_opt phdr_opt fill_opt
                        {
                          ldlex_popstate ();
-                         lang_leave_overlay ($14, $12, $13);
+                         lang_leave_overlay ($15, $12, $14, $13);
                        }
                opt_comma
        |       /* The GROUP case is just enough to support the gcc
@@ -1107,6 +1115,7 @@ vers_defns:
                        }
                vers_defns '}'
                        {
+                         $$ = $5;
                          ldgram_vers_current_lang = $<name>4;
                        }
        ;
This page took 0.025413 seconds and 4 git commands to generate.