aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2021-08-13 17:21:14 +0930
committerAlan Modra <amodra@gmail.com>2021-08-13 18:23:35 +0930
commit3bb17dfb6b4f869e2850329be710176b7ff0cb84 (patch)
treeba6febe0e1b42a8670ee1850fa317d30cee2aefd
parent1374be23274d0d569ca160b8172b2c02fc37becc (diff)
downloadfsf-binutils-gdb-3bb17dfb6b4f869e2850329be710176b7ff0cb84.zip
fsf-binutils-gdb-3bb17dfb6b4f869e2850329be710176b7ff0cb84.tar.gz
fsf-binutils-gdb-3bb17dfb6b4f869e2850329be710176b7ff0cb84.tar.bz2
Re: PR28217, Syntax error when memory region contains a hyphen
I discovered some more errors when tightening up the lexer rules. Just because we INCLUDE a file doesn't mean we've switched states. PR 28217 * ldgram.y (statement): Don't switch lexer state on INCLUDE. (mri_script_command, ifile_p1, memory_spec, section): Likewise.
-rw-r--r--ld/ldgram.y13
1 files changed, 3 insertions, 10 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y
index 4910e17..794cf28 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -248,9 +248,8 @@ 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); }
|
@@ -346,9 +345,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);
@@ -697,11 +695,9 @@ statement:
}
| INCLUDE filename
{
- ldlex_script ();
ldfile_open_command_file ($2);
}
statement_list_opt END
- { ldlex_popstate (); }
;
statement_list:
@@ -814,9 +810,8 @@ memory_spec: NAME
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:
@@ -1117,11 +1112,9 @@ section: NAME
'{' sec_or_group_p1 '}'
| INCLUDE filename
{
- ldlex_script ();
ldfile_open_command_file ($2);
}
sec_or_group_p1 END
- { ldlex_popstate (); }
;
type: