diff options
author | Hans-Peter Nilsson <hp@bitrange.com> | 2014-10-15 03:10:25 +0200 |
---|---|---|
committer | Hans-Peter Nilsson <hp@bitrange.com> | 2014-10-15 03:10:25 +0200 |
commit | eeed9cc785ca447868967e5c84dae63e9ca8e6c2 (patch) | |
tree | 6e3b704c2f61b465b83ec2c5b2b5331b6c1e2b30 /ld/ChangeLog | |
parent | bfa234344327776fb3b16e8bfd9c8de6ec73ae31 (diff) | |
download | gdb-eeed9cc785ca447868967e5c84dae63e9ca8e6c2.zip gdb-eeed9cc785ca447868967e5c84dae63e9ca8e6c2.tar.gz gdb-eeed9cc785ca447868967e5c84dae63e9ca8e6c2.tar.bz2 |
Allow unquoted = as the first character in ldscript input_list names
* ldlex.l (INPUTLIST): New start condition.
(comment pattern, ",", "(", ")", "AS_NEEDED")
({FILENAMECHAR1}{FILENAMECHAR}*, "-l"{FILENAMECHAR}+)
(quoted string pattern, whitespace pattern): Add INPUTLIST to
valid start conditions.
(<INPUTLIST>"="{FILENAMECHAR1}{FILENAMECHAR}*): New NAME rule.
(ldlex_inputlist): New start-condition-setter function.
* ldgram.y (input_list1): Rename from input_list. All recursive
use changed.
(input_list): New wrapper rule for input_list1, setting
INPUTLIST lexer state for the duration of parsing input_list1.
All this to say INPUT(=/path/to/file) and not be forced to use
INPUT("=/path/to/file") whenever there's a need to force a sysroot-
prefix. Still, IMHO it seems better to make use of a previously
invalid syntax and not only change the meaning of quoted =-prefixed
paths (though arguably that's not very useful before this patchset).
This got a little bit hairier than I'd expected: I had to add a new
lexer state (aka. start condition) to avoid a first "=" being lexed as
the token "=", despite that not making sense in constructs expecting
file-names in the first place. (The grammar doesn't allow for
expressions in any part of those lists.) I guess I *could* have made
it work using that token anyway, but I didn't like the idea that you
would be able to separate the "=" from the rest of the file-name with
whitespace.
Diffstat (limited to 'ld/ChangeLog')
-rw-r--r-- | ld/ChangeLog | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 49a0a66..6a91a25 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,5 +1,16 @@ 2014-10-15 Hans-Peter Nilsson <hp@axis.com> + * ldlex.l (INPUTLIST): New start condition. + (comment pattern, ",", "(", ")", "AS_NEEDED") + ({FILENAMECHAR1}{FILENAMECHAR}*, "-l"{FILENAMECHAR}+) + (quoted string pattern, whitespace pattern): Add INPUTLIST to + valid start conditions. + (<INPUTLIST>"="{FILENAMECHAR1}{FILENAMECHAR}*): New NAME rule. + (ldlex_inputlist): New start-condition-setter function. + * ldgram.y (input_list1): Rename from input_list. All recursive + use changed. + (input_list): New wrapper rule for input_list1, setting + INPUTLIST lexer state for the duration of parsing input_list1. * ldlang.c (lang_add_input_file): If the first character in the filename is '=', prepend the sysroot and force the context of that input file to non-sysroot. |