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.
This commit is contained in:
Alan Modra 2012-03-08 05:29:33 +00:00
parent 4e3aa40890
commit f4a23d427d
7 changed files with 60 additions and 72 deletions

View file

@ -1064,6 +1064,7 @@ new_afile (const char *name,
p->flags.add_DT_NEEDED_for_dynamic = input_flags.add_DT_NEEDED_for_dynamic;
p->flags.add_DT_NEEDED_for_regular = input_flags.add_DT_NEEDED_for_regular;
p->flags.whole_archive = input_flags.whole_archive;
p->flags.sysrooted = input_flags.sysrooted;
if (file_type == lang_input_file_is_l_enum
&& name[0] == ':' && name[1] != '\0')
@ -1101,7 +1102,6 @@ new_afile (const char *name,
p->local_sym_name = name;
p->flags.real = TRUE;
p->flags.search_dirs = TRUE;
p->flags.sysrooted = input_flags.sysrooted;
break;
case lang_input_file_is_file_enum:
p->filename = name;
@ -2716,7 +2716,6 @@ load_symbols (lang_input_statement_type *entry,
ldfile_open_command_file (entry->filename);
push_stat_ptr (place);
input_flags.sysrooted = entry->flags.sysrooted;
input_flags.add_DT_NEEDED_for_regular
= entry->flags.add_DT_NEEDED_for_regular;
input_flags.add_DT_NEEDED_for_dynamic
@ -2729,7 +2728,9 @@ load_symbols (lang_input_statement_type *entry,
yyparse ();
ldfile_assumed_script = FALSE;
/* missing_file is sticky. */
/* missing_file is sticky. sysrooted will already have been
restored when seeing EOF in yyparse, but no harm to restore
again. */
save_flags.missing_file |= input_flags.missing_file;
input_flags = save_flags;
pop_stat_ptr ();