2009-10-10 Chris Demetriou <cgd@google.com>

* options.h (Input_file_argument::Input_file_type): New enum.
	(Input_file_argument::is_lib_): Replace with...
	(Input_file_argument::type_): New member.
	(Input_file_argument::Input_file_argument): Take Input_file_type
	'type' rather than boolean 'is_lib' as second argument.
	(Input_file_argument::is_lib): Use type_.
	(Input_file_argument::is_searched_file): New function.
	(Input_file_argument::may_need_search): Handle is_searched_file.
	* options.cc (General_options::parse_library): Support -l:filename.
	(General_options::parse_just_symbols): Update for Input_file_argument
	changes.
	(Command_line::process): Likewise.
	* archive.cc (Archive::get_file_and_offset): Likewise.
	* plugin.cc (Plugin_manager::release_input_file): Likewise.
	* script.cc (read_script_file, script_add_file): Likewise.
	* fileread.cc (Input_file::Input_file): Likewise.
	(Input_file::will_search_for): Handle is_searched_file.
	(Input_file::open): Likewise.
	* readsyms.cc (Read_symbols::get_name): Likewise.
	* testsuite/Makefile.am (searched_file_test): New test.
	* testsuite/Makefile.in: Regenerate.
	* testsuite/searched_file_test.cc: New file.
	* testsuite/searched_file_test_lib.cc: New file.
This commit is contained in:
Chris Demetriou
2009-10-10 07:39:04 +00:00
parent f080369056
commit ae3b518947
12 changed files with 237 additions and 47 deletions

View File

@@ -1452,7 +1452,9 @@ read_script_file(const char* filename, Command_line* cmdline,
Position_dependent_options posdep = cmdline->position_dependent_options();
if (posdep.format_enum() == General_options::OBJECT_FORMAT_BINARY)
posdep.set_format_enum(General_options::OBJECT_FORMAT_ELF);
Input_file_argument input_argument(filename, false, "", false, posdep);
Input_file_argument input_argument(filename,
Input_file_argument::INPUT_FILE_TYPE_FILE,
"", false, posdep);
Input_file input_file(&input_argument);
int dummy = 0;
if (!input_file.open(dirsearch, task, &dummy))
@@ -2179,8 +2181,10 @@ script_add_file(void* closurev, const char* name, size_t length)
}
}
Input_file_argument file(name_string.c_str(), false, extra_search_path,
false, closure->position_dependent_options());
Input_file_argument file(name_string.c_str(),
Input_file_argument::INPUT_FILE_TYPE_FILE,
extra_search_path, false,
closure->position_dependent_options());
closure->inputs()->add_file(file);
}