Another ld script backtrack
authorAlan Modra <amodra@gmail.com>
Tue, 17 Aug 2021 06:22:20 +0000 (15:52 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 18 Aug 2021 04:06:57 +0000 (13:36 +0930)
* ldgram.y (length_spec): Throw away look-ahead NAME.

ld/ldgram.y

index a0c881e9a736344d817bc9dd17d73b4e7990db48..c8396bbfd5b9e19b86bf61c0b632fb748a270b30 100644 (file)
@@ -809,6 +809,11 @@ origin_spec:
 length_spec:
             LENGTH '=' mustbe_exp
                {
+                 if (yychar == NAME)
+                   {
+                     yyclearin;
+                     ldlex_backup ();
+                   }
                  region->length_exp = $3;
                }
        ;