diff options
author | Alan Modra <amodra@bigpond.net.au> | 2012-03-08 05:29:31 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2012-03-08 05:29:31 +0000 |
commit | 0e11a417df9174426299028994306df829a217ae (patch) | |
tree | b0b9f76ee519cdaeb250c00e0c992da69acc59ba /ld/ldlex.l | |
parent | 0bd04f7f6bb21ca100662a6a17edaba6ed1222b4 (diff) | |
download | binutils-redhat-0e11a417df9174426299028994306df829a217ae.tar.gz |
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
diff --git a/ld/ldlex.l b/ld/ldlex.l index 33dd83d66f..7da611fd70 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -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)); } |