From: Alan Modra Date: Wed, 11 Aug 2021 08:46:35 +0000 (+0930) Subject: PR28198, Support # as linker script comment marker X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cc9faa98adc96788e6a560c685bbd8e69c856cb7;p=binutils-gdb.git PR28198, Support # as linker script comment marker PR 28198 * ldlex.l: Combine rules for handling newline, whitespace and comments. Extend # comment handling to all states. --- diff --git a/ld/ldlex.l b/ld/ldlex.l index 25b4bcaae01..f588bd3adc5 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -420,8 +420,13 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* yylval.name[len] = 0; return NAME; } -"\n" { lineno++;} -[ \t\r]+ { } + +"\n" { + lineno++; } +[ \t\r]+ { + /* Eat up whitespace */ } +#.* { + /* Eat up comments */ } [:,;] { return *yytext; } @@ -450,12 +455,6 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* return *yytext; } -[\n] { lineno++; } - -#.* { /* Eat up comments */ } - -[ \t\r]+ { /* Eat up whitespace */ } - <> { include_stack_ptr--; if (include_stack_ptr == 0)