diff options
author | Alan Modra <amodra@gmail.com> | 2012-03-08 05:29:33 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2012-03-08 05:29:33 +0000 |
commit | f4a23d427dc7ac56aa4de7a8d29e899e936ce841 (patch) | |
tree | 18bc44195d1ed303ffa9a5daef8e33eae320a256 /ld/ldlex.l | |
parent | 4e3aa408903f6f4ed9177fff7def91fe6bb8fd2b (diff) | |
download | gdb-f4a23d427dc7ac56aa4de7a8d29e899e936ce841.zip gdb-f4a23d427dc7ac56aa4de7a8d29e899e936ce841.tar.gz gdb-f4a23d427dc7ac56aa4de7a8d29e899e936ce841.tar.bz2 |
PR ld/10340
* ldfile.c (is_sysrooted_pathname): Remove notsame param.
(ldfile_add_library_path): Don't set sysrooted flag.
(ldfile_open_file_search): Likewise, and don't copy them.
(try_open): Delete exten and code handling such. Add sysrooted
param and return whether path is in sysroot.
(ldfile_find_command_file): Delete extend param. Add sysrooted
param. Rename local var. Update try_open calls.
(ldfile_open_command_file_1): Pass sysrooted to lex_push_file.
* ldfile.h (search_dirs_type): Remove sysrooted field.
* ldlang.c (new_afile): Always set sysrooted from input_flags.
(load_symbols): Don't set input_flags.sysrooted.
* ldlang.h (struct lang_input_statement_flags): Revise sysrooted
comment.
* ldlex.h (lex_push_file): Update prototype.
* ldlex.l (sysrooted_stack): New array.
(EOF): Pop input_flags.sysrooted.
(lex_push_file): Add sysrooted param. Save and set
input_flags.sysrooted.
Diffstat (limited to 'ld/ldlex.l')
-rw-r--r-- | ld/ldlex.l | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -68,6 +68,7 @@ const char *lex_string = NULL; static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; static const char *file_name_stack[MAX_INCLUDE_DEPTH]; static unsigned int lineno_stack[MAX_INCLUDE_DEPTH]; +static unsigned int sysrooted_stack[MAX_INCLUDE_DEPTH]; static unsigned int include_stack_ptr = 0; static int vers_node_nesting = 0; @@ -454,6 +455,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* yy_switch_to_buffer (include_stack[include_stack_ptr]); lineno = lineno_stack[include_stack_ptr]; + input_flags.sysrooted = sysrooted_stack[include_stack_ptr]; return END; } @@ -468,7 +470,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* saving the current input info on the include stack. */ void -lex_push_file (FILE *file, const char *name) +lex_push_file (FILE *file, const char *name, unsigned int sysrooted) { if (include_stack_ptr >= MAX_INCLUDE_DEPTH) { @@ -476,10 +478,12 @@ lex_push_file (FILE *file, const char *name) } file_name_stack[include_stack_ptr] = name; lineno_stack[include_stack_ptr] = lineno; + sysrooted_stack[include_stack_ptr] = input_flags.sysrooted; include_stack[include_stack_ptr] = YY_CURRENT_BUFFER; include_stack_ptr++; lineno = 1; + input_flags.sysrooted = sysrooted; yyin = file; yy_switch_to_buffer (yy_create_buffer (yyin, YY_BUF_SIZE)); } |