]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Revert "ld script expression parsing"
authorAlan Modra <amodra@gmail.com>
Wed, 11 Aug 2021 00:41:19 +0000 (10:11 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 11 Aug 2021 00:43:48 +0000 (10:13 +0930)
This reverts commit 40726f16a8d7105761e36398054860a923d4efc9.

ld/ChangeLog
ld/ldgram.y
ld/ldlex.h
ld/ldlex.l

index f546c792eccdb4443b0c7a4f1b0497ba42336b6f..5048b5b6a173f34b857c14ee5694617d71723423 100644 (file)
 
        * configure.tgt: Add *-*-genode* as a target for AArch64 and x86.
 
-2021-02-01  Alan Modra  <amodra@gmail.com>
-
-       * ldgram.y (section): Call ldlex_backup.  Remove empty action.
-       * ldlex.h (ldlex_backup): Declare.
-       * ldlex.l (<EXPRESSION>NAME): Don't use NOCFILENAMECHAR set of
-       chars, use SYMBOLNAMECHAR.
-       (ldlex_backup): New function.
-
 2021-02-01  Alan Modra  <amodra@gmail.com>
 
        * ldgram.y: Whitespace fixes.
index 6508393db63a1a6c37c27c9fce6608009904e8ac..7f8f03570dc676c48927a4514140b225c1c7fbdf 100644 (file)
@@ -1071,15 +1071,11 @@ section:        NAME            { ldlex_expression(); }
                '}' { ldlex_popstate (); ldlex_expression (); }
                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);
                }
                opt_comma
+               {}
        |       OVERLAY
                        { ldlex_expression (); }
                opt_exp_without_type opt_nocrossrefs opt_at opt_subalign
@@ -1093,11 +1089,6 @@ section: NAME            { ldlex_expression(); }
                        { ldlex_popstate (); ldlex_expression (); }
                memspec_opt memspec_at_opt phdr_opt fill_opt
                        {
-                         if (yychar == NAME)
-                           {
-                             yyclearin;
-                             ldlex_backup ();
-                           }
                          ldlex_popstate ();
                          lang_leave_overlay ($5, (int) $4,
                                              $16, $13, $15, $14);
index ddf00b2fa18b7819e2dcd9205873d8824f4dff5f..f035ce8ae4d58db7fb2d029dc300d2df330547ac 100644 (file)
@@ -193,7 +193,6 @@ extern void ldlex_defsym (void);
 extern void ldlex_expression (void);
 extern void ldlex_both (void);
 extern void ldlex_popstate (void);
-extern void ldlex_backup (void);
 extern const char* ldlex_filename (void);
 
 /* In lexsup.c.  */
index 7652e8d2a29a432faaa4c6ffe2a5872c24a2c28a..237892c0ec3a181e773e5197443aa25be4e05fd2 100644 (file)
@@ -385,7 +385,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
                                  yylval.name = xstrdup (yytext + 2);
                                  return LNAME;
                                }
-<EXPRESSION>{SYMBOLNAMECHAR1}{SYMBOLNAMECHAR}* {
+<EXPRESSION>{SYMBOLNAMECHAR1}{NOCFILENAMECHAR}* {
                                  yylval.name = xstrdup (yytext);
                                  return NAME;
                                }
@@ -636,16 +636,6 @@ ldlex_popstate (void)
   yy_start = *(--state_stack_p);
 }
 
-/* In cases where the parser needs to look ahead and the context
-   changes from expression to script or vice-versa, throw away a
-   NAME.  What constitutes a NAME depends on context.  */
-
-void
-ldlex_backup (void)
-{
-  yyless (0);
-}
-
 /* Return the current file name, or the previous file if no file is
    current.  */