]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - ld/ldgram.y
2.41 Release sources
[thirdparty/binutils-gdb.git] / ld / ldgram.y
index 08dc110f3da9993c10165e65b183a9e15cd1901b..081176ba0f133658e4dec7c9e7b6a76bba0e90b3 100644 (file)
@@ -1,5 +1,5 @@
 /* A YACC grammar to parse a superset of the AT&T linker scripting language.
-   Copyright (C) 1991-2021 Free Software Foundation, Inc.
+   Copyright (C) 1991-2023 Free Software Foundation, Inc.
    Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
 
    This file is part of the GNU Binutils.
 #endif
 
 static enum section_type sectype;
+static etree_type *sectype_value;
 static lang_memory_region_type *region;
 
-static bfd_boolean ldgram_had_keep = FALSE;
+static bool ldgram_had_keep = false;
 static char *ldgram_vers_current_lang = NULL;
 
 #define ERROR_NAME_MAX 20
@@ -77,8 +78,8 @@ static int error_index;
   union etree_union *etree;
   struct phdr_info
     {
-      bfd_boolean filehdr;
-      bfd_boolean phdrs;
+      bool filehdr;
+      bool phdrs;
       union etree_union *at;
       union etree_union *flags;
     } phdr;
@@ -96,8 +97,7 @@ static int error_index;
 %type <wildcard_list> section_name_list
 %type <flag_info_list> sect_flag_list
 %type <flag_info> sect_flags
-%type <name> memspec_opt casesymlist
-%type <name> memspec_at_opt
+%type <name> memspec_opt memspec_at_opt paren_script_name casesymlist
 %type <cname> wildcard_name
 %type <wildcard> section_name_spec filename_spec wildcard_maybe_exclude
 %token <bigint> INT
@@ -125,8 +125,8 @@ static int error_index;
 %right UNARY
 %token END
 %left <token> '('
-%token <token> ALIGN_K BLOCK BIND QUAD SQUAD LONG SHORT BYTE
-%token SECTIONS PHDRS INSERT_K AFTER BEFORE
+%token <token> ALIGN_K BLOCK BIND QUAD SQUAD LONG SHORT BYTE ASCIZ
+%token SECTIONS PHDRS INSERT_K AFTER BEFORE LINKER_VERSION
 %token DATA_SEGMENT_ALIGN DATA_SEGMENT_RELRO_END DATA_SEGMENT_END
 %token SORT_BY_NAME SORT_BY_ALIGNMENT SORT_NONE
 %token SORT_BY_INIT_PRIORITY
@@ -139,6 +139,8 @@ static int error_index;
 %token REGION_ALIAS
 %token LD_FEATURE
 %token NOLOAD DSECT COPY INFO OVERLAY
+%token READONLY
+%token TYPE
 %token DEFINED TARGET_K SEARCH_DIR MAP ENTRY
 %token <integer> NEXT
 %token SIZEOF ALIGNOF ADDR LOADADDR MAX_K MIN_K
@@ -176,12 +178,9 @@ filename:  NAME;
 
 
 defsym_expr:
-               { ldlex_defsym(); }
-               NAME '=' exp
-               {
-                 ldlex_popstate();
-                 lang_add_assignment (exp_defsym ($2, $4));
-               }
+               { ldlex_expression(); }
+               assignment
+               { ldlex_popstate(); }
        ;
 
 /* SYNTAX WITHIN AN MRI SCRIPT FILE */
@@ -251,11 +250,10 @@ mri_script_command:
        |       CASE casesymlist
        |       EXTERN extern_name_list
        |       INCLUDE filename
-               { ldlex_script (); ldfile_open_command_file($2); }
+               { ldfile_open_command_file ($2); }
                mri_script_lines END
-               { ldlex_popstate (); }
        |       START NAME
-               { lang_add_entry ($2, FALSE); }
+               { lang_add_entry ($2, false); }
        |
        ;
 
@@ -284,25 +282,19 @@ casesymlist:
        | casesymlist ',' NAME
        ;
 
-/* Parsed as expressions so that commas separate entries */
 extern_name_list:
-       { ldlex_expression (); }
-       extern_name_list_body
-       { ldlex_popstate (); }
-
-extern_name_list_body:
-         NAME
-                       { ldlang_add_undef ($1, FALSE); }
-       | extern_name_list_body NAME
-                       { ldlang_add_undef ($2, FALSE); }
-       | extern_name_list_body ',' NAME
-                       { ldlang_add_undef ($3, FALSE); }
+       NAME
+                       { ldlang_add_undef ($1, false); }
+       | extern_name_list NAME
+                       { ldlang_add_undef ($2, false); }
+       | extern_name_list ',' NAME
+                       { ldlang_add_undef ($3, false); }
        ;
 
 script_file:
-       { ldlex_both(); }
+       { ldlex_script (); }
        ifile_list
-       { ldlex_popstate(); }
+       { ldlex_popstate (); }
        ;
 
 ifile_list:
@@ -325,7 +317,7 @@ ifile_p1:
        |       TARGET_K '(' NAME ')'
                { lang_add_target($3); }
        |       SEARCH_DIR '(' filename ')'
-               { ldfile_add_library_path ($3, FALSE); }
+               { ldfile_add_library_path ($3, false); }
        |       OUTPUT '(' filename ')'
                { lang_add_output($3, 1); }
        |       OUTPUT_FORMAT '(' NAME ')'
@@ -336,11 +328,11 @@ ifile_p1:
        |       OUTPUT_ARCH '(' NAME ')'
                  { ldfile_set_output_arch ($3, bfd_arch_unknown); }
        |       FORCE_COMMON_ALLOCATION
-               { command_line.force_common_definition = TRUE ; }
+               { command_line.force_common_definition = true ; }
        |       FORCE_GROUP_ALLOCATION
-               { command_line.force_group_allocation = TRUE ; }
+               { command_line.force_group_allocation = true ; }
        |       INHIBIT_COMMON_ALLOCATION
-               { link_info.inhibit_common_definition = TRUE ; }
+               { link_info.inhibit_common_definition = true ; }
        |       INPUT '(' input_list ')'
        |       GROUP
                  { lang_enter_group (); }
@@ -349,9 +341,8 @@ ifile_p1:
        |       MAP '(' filename ')'
                { lang_add_map($3); }
        |       INCLUDE filename
-               { ldlex_script (); ldfile_open_command_file($2); }
+               { ldfile_open_command_file ($2); }
                ifile_list END
-               { ldlex_popstate (); }
        |       NOCROSSREFS '(' nocrossref_list ')'
                {
                  lang_add_nocrossref ($3);
@@ -360,7 +351,8 @@ ifile_p1:
                {
                  lang_add_nocrossref_to ($3);
                }
-       |       EXTERN '(' extern_name_list ')'
+       |       EXTERN '(' { ldlex_expression (); } extern_name_list ')'
+                       { ldlex_popstate (); }
        |       INSERT_K AFTER NAME
                { lang_add_insert ($3, 0); }
        |       INSERT_K BEFORE NAME
@@ -397,17 +389,17 @@ input_list1:
                                 (char *)NULL); }
        |       AS_NEEDED '('
                  { $<integer>$ = input_flags.add_DT_NEEDED_for_regular;
-                   input_flags.add_DT_NEEDED_for_regular = TRUE; }
+                   input_flags.add_DT_NEEDED_for_regular = true; }
                     input_list1 ')'
                  { input_flags.add_DT_NEEDED_for_regular = $<integer>3; }
        |       input_list1 ',' AS_NEEDED '('
                  { $<integer>$ = input_flags.add_DT_NEEDED_for_regular;
-                   input_flags.add_DT_NEEDED_for_regular = TRUE; }
+                   input_flags.add_DT_NEEDED_for_regular = true; }
                     input_list1 ')'
                  { input_flags.add_DT_NEEDED_for_regular = $<integer>5; }
        |       input_list1 AS_NEEDED '('
                  { $<integer>$ = input_flags.add_DT_NEEDED_for_regular;
-                   input_flags.add_DT_NEEDED_for_regular = TRUE; }
+                   input_flags.add_DT_NEEDED_for_regular = true; }
                     input_list1 ')'
                  { input_flags.add_DT_NEEDED_for_regular = $<integer>4; }
        ;
@@ -424,28 +416,18 @@ sec_or_group_p1:
 
 statement_anywhere:
                ENTRY '(' NAME ')'
-               { lang_add_entry ($3, FALSE); }
-       |       assignment end
+               { lang_add_entry ($3, false); }
+       |       assignment separator
        |       ASSERT_K  {ldlex_expression ();} '(' exp ',' NAME ')'
                { ldlex_popstate ();
                  lang_add_assignment (exp_assert ($4, $6)); }
        ;
 
-/* The '*' and '?' cases are there because the lexer returns them as
-   separate tokens rather than as NAME.  */
 wildcard_name:
                NAME
                        {
                          $$ = $1;
                        }
-       |       '*'
-                       {
-                         $$ = "*";
-                       }
-       |       '?'
-                       {
-                         $$ = "?";
-                       }
        ;
 
 wildcard_maybe_exclude:
@@ -537,7 +519,7 @@ sect_flag_list:     NAME
                              n->with = with_flags;
                              n->name = $1;
                            }
-                         n->valid = FALSE;
+                         n->valid = false;
                          n->next = NULL;
                          $$ = n;
                        }
@@ -555,7 +537,7 @@ sect_flag_list:     NAME
                              n->with = with_flags;
                              n->name = $3;
                            }
-                         n->valid = FALSE;
+                         n->valid = false;
                          n->next = $1;
                          $$ = n;
                        }
@@ -567,7 +549,7 @@ sect_flags:
                          struct flag_info *n;
                          n = ((struct flag_info *) xmalloc (sizeof *n));
                          n->flag_list = $3;
-                         n->flags_initialized = FALSE;
+                         n->flags_initialized = false;
                          n->not_with_flags = 0;
                          n->only_with_flags = 0;
                          $$ = n;
@@ -660,26 +642,25 @@ input_section_spec_no_keep:
 input_section_spec:
                input_section_spec_no_keep
        |       KEEP '('
-                       { ldgram_had_keep = TRUE; }
+                       { ldgram_had_keep = true; }
                input_section_spec_no_keep ')'
-                       { ldgram_had_keep = FALSE; }
+                       { ldgram_had_keep = false; }
        ;
 
 statement:
-               assignment end
-       |       CREATE_OBJECT_SYMBOLS
+       ';'
+       | assignment separator
+       | CREATE_OBJECT_SYMBOLS
                {
-               lang_add_attribute(lang_object_symbols_statement_enum);
+                 lang_add_attribute (lang_object_symbols_statement_enum);
                }
-       |       ';'
-       |       CONSTRUCTORS
+       | CONSTRUCTORS
                {
-
-                 lang_add_attribute(lang_constructors_statement_enum);
+                 lang_add_attribute (lang_constructors_statement_enum);
                }
        | SORT_BY_NAME '(' CONSTRUCTORS ')'
                {
-                 constructors_sorted = TRUE;
+                 constructors_sorted = true;
                  lang_add_attribute (lang_constructors_statement_enum);
                }
        | input_section_spec
@@ -687,18 +668,30 @@ statement:
                {
                  lang_add_data ((int) $1, $3);
                }
-
+       | ASCIZ NAME
+               {
+                 lang_add_string ($2);
+               }
        | FILL '(' fill_exp ')'
                {
                  lang_add_fill ($3);
                }
-       | ASSERT_K  {ldlex_expression ();} '(' exp ',' NAME ')' end
-                       { ldlex_popstate ();
-                         lang_add_assignment (exp_assert ($4, $6)); }
+       | LINKER_VERSION
+               {
+                 lang_add_version_string ();
+               }
+       | ASSERT_K
+               { ldlex_expression (); }
+         '(' exp ',' NAME ')' separator
+               {
+                 ldlex_popstate ();
+                 lang_add_assignment (exp_assert ($4, $6));
+               }
        | INCLUDE filename
-               { ldlex_script (); ldfile_open_command_file($2); }
-               statement_list_opt END
-               { ldlex_popstate (); }
+               {
+                 ldfile_open_command_file ($2);
+               }
+         statement_list_opt END
        ;
 
 statement_list:
@@ -727,7 +720,7 @@ length:
 fill_exp:
        mustbe_exp
                {
-                 $$ = exp_get_fill ($1, 0, "fill value");
+                 $$ = exp_get_fill ($1, 0, _("fill value"));
                }
        ;
 
@@ -757,14 +750,14 @@ assign_op:
 
        ;
 
-end:   ';' | ','
+separator:     ';' | ','
        ;
 
 
 assignment:
                NAME '=' mustbe_exp
                {
-                 lang_add_assignment (exp_assign ($1, $3, FALSE));
+                 lang_add_assignment (exp_assign ($1, $3, false));
                }
        |       NAME assign_op mustbe_exp
                {
@@ -772,19 +765,19 @@ assignment:
                                                   exp_binop ($2,
                                                              exp_nameop (NAME,
                                                                          $1),
-                                                             $3), FALSE));
+                                                             $3), false));
                }
        |       HIDDEN '(' NAME '=' mustbe_exp ')'
                {
-                 lang_add_assignment (exp_assign ($3, $5, TRUE));
+                 lang_add_assignment (exp_assign ($3, $5, true));
                }
        |       PROVIDE '(' NAME '=' mustbe_exp ')'
                {
-                 lang_add_assignment (exp_provide ($3, $5, FALSE));
+                 lang_add_assignment (exp_provide ($3, $5, false));
                }
        |       PROVIDE_HIDDEN '(' NAME '=' mustbe_exp ')'
                {
-                 lang_add_assignment (exp_provide ($3, $5, TRUE));
+                 lang_add_assignment (exp_provide ($3, $5, true));
                }
        ;
 
@@ -806,14 +799,13 @@ memory_spec_list:
 
 
 memory_spec:   NAME
-               { region = lang_memory_region_lookup ($1, TRUE); }
+               { region = lang_memory_region_lookup ($1, true); }
                attributes_opt ':'
                origin_spec opt_comma length_spec
                {}
        |       INCLUDE filename
-               { ldlex_script (); ldfile_open_command_file($2); }
+               { ldfile_open_command_file ($2); }
                memory_spec_list_opt END
-               { ldlex_popstate (); }
        ;
 
 origin_spec:
@@ -826,6 +818,11 @@ origin_spec:
 length_spec:
             LENGTH '=' mustbe_exp
                {
+                 if (yychar == NAME)
+                   {
+                     yyclearin;
+                     ldlex_backup ();
+                   }
                  region->length_exp = $3;
                }
        ;
@@ -878,9 +875,9 @@ low_level_library_NAME_list:
 
 floating_point_support:
                FLOAT
-                       { lang_float(TRUE); }
+                       { lang_float(true); }
        |       NOFLOAT
-                       { lang_float(FALSE); }
+                       { lang_float(false); }
        ;
 
 nocrossref_list:
@@ -908,9 +905,13 @@ nocrossref_list:
                }
        ;
 
-mustbe_exp:             { ldlex_expression (); }
+paren_script_name:     { ldlex_script (); }
+               '(' NAME ')'
+                       { ldlex_popstate (); $$ = $3; }
+
+mustbe_exp:            { ldlex_expression (); }
                exp
-                        { ldlex_popstate (); $$=$2;}
+                       { ldlex_popstate (); $$ = $2; }
        ;
 
 exp    :
@@ -972,14 +973,14 @@ exp       :
        |       SIZEOF_HEADERS
                        { $$ = exp_nameop (SIZEOF_HEADERS,0); }
 
-       |       ALIGNOF '(' NAME ')'
-                       { $$ = exp_nameop (ALIGNOF,$3); }
-       |       SIZEOF '(' NAME ')'
-                       { $$ = exp_nameop (SIZEOF,$3); }
-       |       ADDR '(' NAME ')'
-                       { $$ = exp_nameop (ADDR,$3); }
-       |       LOADADDR '(' NAME ')'
-                       { $$ = exp_nameop (LOADADDR,$3); }
+       |       ALIGNOF paren_script_name
+                       { $$ = exp_nameop (ALIGNOF, $2); }
+       |       SIZEOF  paren_script_name
+                       { $$ = exp_nameop (SIZEOF, $2); }
+       |       ADDR    paren_script_name
+                       { $$ = exp_nameop (ADDR, $2); }
+       |       LOADADDR paren_script_name
+                       { $$ = exp_nameop (LOADADDR, $2); }
        |       CONSTANT '(' NAME ')'
                        { $$ = exp_nameop (CONSTANT,$3); }
        |       ABSOLUTE '(' exp ')'
@@ -994,15 +995,16 @@ exp       :
                        { $$ = exp_binop (DATA_SEGMENT_RELRO_END, $5, $3); }
        |       DATA_SEGMENT_END '(' exp ')'
                        { $$ = exp_unop (DATA_SEGMENT_END, $3); }
-       |       SEGMENT_START '(' NAME ',' exp ')'
+       |       SEGMENT_START { ldlex_script (); } '(' NAME
+                       { ldlex_popstate (); } ',' exp ')'
                        { /* The operands to the expression node are
                             placed in the opposite order from the way
                             in which they appear in the script as
                             that allows us to reuse more code in
                             fold_binary.  */
                          $$ = exp_binop (SEGMENT_START,
-                                         $5,
-                                         exp_nameop (NAME, $3)); }
+                                         $7,
+                                         exp_nameop (NAME, $4)); }
        |       BLOCK '(' exp ')'
                        { $$ = exp_unop (ALIGN_K,$3); }
        |       NAME
@@ -1013,10 +1015,10 @@ exp     :
                        { $$ = exp_binop (MIN_K, $3, $5 ); }
        |       ASSERT_K '(' exp ',' NAME ')'
                        { $$ = exp_assert ($3, $5); }
-       |       ORIGIN '(' NAME ')'
-                       { $$ = exp_nameop (ORIGIN, $3); }
-       |       LENGTH '(' NAME ')'
-                       { $$ = exp_nameop (LENGTH, $3); }
+       |       ORIGIN paren_script_name
+                       { $$ = exp_nameop (ORIGIN, $2); }
+       |       LENGTH paren_script_name
+                       { $$ = exp_nameop (LENGTH, $2); }
        |       LOG2CEIL '(' exp ')'
                        { $$ = exp_unop (LOG2CEIL, $3); }
        ;
@@ -1054,43 +1056,52 @@ sect_constraint:
        |       { $$ = 0; }
        ;
 
-section:       NAME            { ldlex_expression(); }
+section:       NAME
+                       { ldlex_expression(); }
                opt_exp_with_type
                opt_at
                opt_align
                opt_align_with_input
-               opt_subalign    { ldlex_popstate (); ldlex_script (); }
+               opt_subalign
                sect_constraint
-               '{'
                        {
-                         lang_enter_output_section_statement($1, $3,
-                                                             sectype,
-                                                             $5, $7, $4, $9, $6);
+                         ldlex_popstate ();
+                         ldlex_wild ();
+                         lang_enter_output_section_statement ($1, $3, sectype,
+                                       sectype_value, $5, $7, $4, $8, $6);
                        }
+               '{'
                statement_list_opt
-               '}' { ldlex_popstate (); ldlex_expression (); }
+               '}'
+                       { ldlex_popstate (); }
                memspec_opt memspec_at_opt phdr_opt fill_opt
-               {
-                 if (yychar == NAME)
-                   {
-                     yyclearin;
-                     ldlex_backup ();
-                   }
-                 ldlex_popstate ();
-                 lang_leave_output_section_statement ($18, $15, $17, $16);
-               }
+                       {
+                         /* fill_opt may have switched the lexer into
+                            expression state, and back again, but in
+                            order to find the end of the fill
+                            expression the parser must look ahead one
+                            token.  If it is a NAME, throw it away as
+                            it will have been lexed in the wrong
+                            state.  */
+                         if (yychar == NAME)
+                           {
+                             yyclearin;
+                             ldlex_backup ();
+                           }
+                         lang_leave_output_section_statement ($17, $14,
+                                                              $16, $15);
+                       }
                opt_comma
        |       OVERLAY
                        { ldlex_expression (); }
                opt_exp_without_type opt_nocrossrefs opt_at opt_subalign
-                       { ldlex_popstate (); ldlex_script (); }
+                       { ldlex_popstate (); }
                '{'
                        {
                          lang_enter_overlay ($3, $6);
                        }
                overlay_section
                '}'
-                       { ldlex_popstate (); ldlex_expression (); }
                memspec_opt memspec_at_opt phdr_opt fill_opt
                        {
                          if (yychar == NAME)
@@ -1098,26 +1109,27 @@ section:        NAME            { ldlex_expression(); }
                              yyclearin;
                              ldlex_backup ();
                            }
-                         ldlex_popstate ();
                          lang_leave_overlay ($5, (int) $4,
-                                             $16, $13, $15, $14);
+                                             $15, $12, $14, $13);
                        }
                opt_comma
        |       /* The GROUP case is just enough to support the gcc
                   svr3.ifile script.  It is not intended to be full
                   support.  I'm not even sure what GROUP is supposed
                   to mean.  */
-               GROUP { ldlex_expression (); }
+               GROUP
+                       { ldlex_expression (); }
                opt_exp_with_type
-               {
-                 ldlex_popstate ();
-                 lang_add_assignment (exp_assign (".", $3, FALSE));
-               }
+                       {
+                         ldlex_popstate ();
+                         lang_add_assignment (exp_assign (".", $3, false));
+                       }
                '{' sec_or_group_p1 '}'
        |       INCLUDE filename
-               { ldlex_script (); ldfile_open_command_file($2); }
+                       {
+                         ldfile_open_command_file ($2);
+                       }
                sec_or_group_p1 END
-               { ldlex_popstate (); }
        ;
 
 type:
@@ -1126,7 +1138,10 @@ type:
        |  COPY    { sectype = noalloc_section; }
        |  INFO    { sectype = noalloc_section; }
        |  OVERLAY { sectype = noalloc_section; }
-       ;
+        |  READONLY '(' TYPE '=' exp ')' { sectype = typed_readonly_section; sectype_value = $5; }
+       |  READONLY { sectype = readonly_section; }
+       |  TYPE '=' exp { sectype = type_section; sectype_value = $3; }
+        ;
 
 atype:
                '(' type ')'
@@ -1176,7 +1191,7 @@ phdr_opt:
                  n = ((struct lang_output_section_phdr_list *)
                       xmalloc (sizeof *n));
                  n->name = $3;
-                 n->used = FALSE;
+                 n->used = false;
                  n->next = $1;
                  $$ = n;
                }
@@ -1187,14 +1202,20 @@ overlay_section:
        |       overlay_section
                NAME
                        {
-                         ldlex_script ();
+                         ldlex_wild ();
                          lang_enter_overlay_section ($2);
                        }
-               '{' statement_list_opt '}'
-                       { ldlex_popstate (); ldlex_expression (); }
+               '{'
+               statement_list_opt
+               '}'
+                       { ldlex_popstate (); }
                phdr_opt fill_opt
                        {
-                         ldlex_popstate ();
+                         if (yychar == NAME)
+                           {
+                             yyclearin;
+                             ldlex_backup ();
+                           }
                          lang_leave_overlay_section ($9, $8);
                        }
                opt_comma
@@ -1251,6 +1272,10 @@ phdr_type:
                            $$ = exp_intop (0x6474e550);
                          else if (strcmp (s, "PT_GNU_STACK") == 0)
                            $$ = exp_intop (0x6474e551);
+                         else if (strcmp (s, "PT_GNU_RELRO") == 0)
+                           $$ = exp_intop (0x6474e552);
+                         else if (strcmp (s, "PT_GNU_PROPERTY") == 0)
+                           $$ = exp_intop (0x6474e553);
                          else
                            {
                              einfo (_("\
@@ -1272,9 +1297,9 @@ phdr_qualifiers:
                {
                  $$ = $3;
                  if (strcmp ($1, "FILEHDR") == 0 && $2 == NULL)
-                   $$.filehdr = TRUE;
+                   $$.filehdr = true;
                  else if (strcmp ($1, "PHDRS") == 0 && $2 == NULL)
-                   $$.phdrs = TRUE;
+                   $$.phdrs = true;
                  else if (strcmp ($1, "FLAGS") == 0 && $2 != NULL)
                    $$.flags = $2;
                  else
@@ -1410,19 +1435,19 @@ vers_tag:
 vers_defns:
                VERS_IDENTIFIER
                {
-                 $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang, FALSE);
+                 $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang, false);
                }
        |       NAME
                {
-                 $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang, TRUE);
+                 $$ = lang_new_vers_pattern (NULL, $1, ldgram_vers_current_lang, true);
                }
        |       vers_defns ';' VERS_IDENTIFIER
                {
-                 $$ = lang_new_vers_pattern ($1, $3, ldgram_vers_current_lang, FALSE);
+                 $$ = lang_new_vers_pattern ($1, $3, ldgram_vers_current_lang, false);
                }
        |       vers_defns ';' NAME
                {
-                 $$ = lang_new_vers_pattern ($1, $3, ldgram_vers_current_lang, TRUE);
+                 $$ = lang_new_vers_pattern ($1, $3, ldgram_vers_current_lang, true);
                }
        |       vers_defns ';' EXTERN NAME '{'
                        {
@@ -1449,27 +1474,27 @@ vers_defns:
                        }
        |       GLOBAL
                {
-                 $$ = lang_new_vers_pattern (NULL, "global", ldgram_vers_current_lang, FALSE);
+                 $$ = lang_new_vers_pattern (NULL, "global", ldgram_vers_current_lang, false);
                }
        |       vers_defns ';' GLOBAL
                {
-                 $$ = lang_new_vers_pattern ($1, "global", ldgram_vers_current_lang, FALSE);
+                 $$ = lang_new_vers_pattern ($1, "global", ldgram_vers_current_lang, false);
                }
        |       LOCAL
                {
-                 $$ = lang_new_vers_pattern (NULL, "local", ldgram_vers_current_lang, FALSE);
+                 $$ = lang_new_vers_pattern (NULL, "local", ldgram_vers_current_lang, false);
                }
        |       vers_defns ';' LOCAL
                {
-                 $$ = lang_new_vers_pattern ($1, "local", ldgram_vers_current_lang, FALSE);
+                 $$ = lang_new_vers_pattern ($1, "local", ldgram_vers_current_lang, false);
                }
        |       EXTERN
                {
-                 $$ = lang_new_vers_pattern (NULL, "extern", ldgram_vers_current_lang, FALSE);
+                 $$ = lang_new_vers_pattern (NULL, "extern", ldgram_vers_current_lang, false);
                }
        |       vers_defns ';' EXTERN
                {
-                 $$ = lang_new_vers_pattern ($1, "extern", ldgram_vers_current_lang, FALSE);
+                 $$ = lang_new_vers_pattern ($1, "extern", ldgram_vers_current_lang, false);
                }
        ;
 
@@ -1487,7 +1512,7 @@ yyerror(arg)
     einfo (_("%P:%s: file format not recognized; treating as linker script\n"),
           ldlex_filename ());
   if (error_index > 0 && error_index < ERROR_NAME_MAX)
-    einfo ("%F%P:%pS: %s in %s\n", NULL, arg, error_names[error_index - 1]);
+    einfo (_("%F%P:%pS: %s in %s\n"), NULL, arg, error_names[error_index - 1]);
   else
     einfo ("%F%P:%pS: %s\n", NULL, arg);
 }