From: Alan Modra Date: Fri, 13 Aug 2021 12:53:40 +0000 (+0930) Subject: tidy mri script extern X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=34a7af0facec33bc4fc327578b829c7e340fc2a8;p=binutils-gdb.git tidy mri script extern MRI mode generally doesn't flip lexer states, so let's make MRI mode "extern" not do so either. * ldgram.y (extern_name_list): Don't change lex state here. (ifile_p1): Change state here on EXTERN instead. --- diff --git a/ld/ldgram.y b/ld/ldgram.y index 794cf284a7b..24979deebbe 100644 --- a/ld/ldgram.y +++ b/ld/ldgram.y @@ -280,18 +280,12 @@ 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 + NAME { ldlang_add_undef ($1, false); } - | extern_name_list_body NAME + | extern_name_list NAME { ldlang_add_undef ($2, false); } - | extern_name_list_body ',' NAME + | extern_name_list ',' NAME { ldlang_add_undef ($3, false); } ; @@ -355,7 +349,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