Add support for AIX -blibpath and -bnolibpath.
[deliverable/binutils-gdb.git] / ld / ldgram.y
index 2df9756aa619eb3e03292d7a69c6a4cbf0aa6c72..71da62c86ae62e6bc10c066b5acfc55b4f3dbaa1 100644 (file)
@@ -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 Free Software Foundation, Inc.
+   2001, 2002 Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
 
 This file is part of GNU ld.
@@ -66,6 +66,12 @@ static int error_index;
 %}
 %union {
   bfd_vma integer;
+  struct big_int
+    {
+      bfd_vma integer;
+      char *str;
+    } bigint;
+  fill_type *fill;
   char *name;
   const char *cname;
   struct wildcard_spec wildcard;
@@ -89,14 +95,14 @@ static int error_index;
 
 %type <etree> exp opt_exp_with_type mustbe_exp opt_at phdr_type phdr_val
 %type <etree> opt_exp_without_type
-%type <integer> fill_opt
+%type <fill> fill_opt fill_exp
 %type <name_list> exclude_name_list
 %type <wildcard_list> file_NAME_list
 %type <name> memspec_opt casesymlist
 %type <name> memspec_at_opt
 %type <cname> wildcard_name
 %type <wildcard> wildcard_spec
-%token <integer> INT  
+%token <bigint> INT  
 %token <name> NAME LNAME
 %type <integer> length
 %type <phdr> phdr_qualifiers
@@ -170,6 +176,7 @@ defsym_expr:
                  ldlex_popstate();
                  lang_add_assignment(exp_assop($3,$2,$4));
                }
+       ;
 
 /* SYNTAX WITHIN AN MRI SCRIPT FILE */  
 mri_script_file:
@@ -230,11 +237,11 @@ mri_script_command:
        |       ALIAS NAME ',' NAME
                        { mri_alias($2,$4,0);}
        |       ALIAS NAME ',' INT
-                       { mri_alias($2,0,(int) $4);}
+                       { mri_alias ($2, 0, (int) $4.integer); }
        |       BASE     exp
                        { mri_base($2); }
-        |       TRUNCATE INT
-               {  mri_truncate((unsigned int) $2); }
+       |       TRUNCATE INT
+               { mri_truncate ((unsigned int) $2.integer); }
        |       CASE casesymlist
        |       EXTERN extern_name_list
        |       INCLUDE filename
@@ -512,16 +519,12 @@ statement:
        | input_section_spec
         | length '(' mustbe_exp ')'
                        {
-                       lang_add_data((int) $1,$3);
+                         lang_add_data ((int) $1, $3);
                        }
   
-       | FILL '(' mustbe_exp ')'
+       | FILL '(' fill_exp ')'
                        {
-                         lang_add_fill
-                           (exp_get_value_int($3,
-                                              0,
-                                              "fill value",
-                                              lang_first_phase_enum));
+                         lang_add_fill ($3);
                        }
        ;
 
@@ -548,18 +551,21 @@ length:
                        { $$ = $1; }
        ;
 
-fill_opt:
-          '=' mustbe_exp
+fill_exp:
+       mustbe_exp
                {
-                 $$ =   exp_get_value_int($2,
-                                          0,
-                                          "fill value",
-                                          lang_first_phase_enum);
+                 $$ = exp_get_fill ($1,
+                                    0,
+                                    "fill value",
+                                    lang_first_phase_enum);
                }
-       |       { $$ = 0; }
        ;
 
-               
+fill_opt:
+         '=' fill_exp
+               { $$ = $2; }
+       |       { $$ = (fill_type *) 0; }
+       ;
 
 assign_op:
                PLUSEQ
@@ -781,7 +787,7 @@ exp :
        |       DEFINED '(' NAME ')'
                        { $$ = exp_nameop(DEFINED, $3); }
        |       INT
-                       { $$ = exp_intop($1); }
+                       { $$ = exp_bigintop ($1.integer, $1.str); }
         |      SIZEOF_HEADERS
                        { $$ = exp_nameop(SIZEOF_HEADERS,0); }
 
This page took 0.024448 seconds and 4 git commands to generate.