diff options
author | Chris Demetriou <cgd@broadcom.com> | 2009-10-10 07:39:04 +0000 |
---|---|---|
committer | Chris Demetriou <cgd@broadcom.com> | 2009-10-10 07:39:04 +0000 |
commit | 88768141ba747ca859f64620927bf45e75c0832a (patch) | |
tree | 616e0e1b6d8a9223f3a31b60662cb7867fb1b14e /gold/options.cc | |
parent | 867783f0c2d82d1897f5dba81e16b90a45f0c5bd (diff) | |
download | binutils-redhat-88768141ba747ca859f64620927bf45e75c0832a.tar.gz |
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.
Diffstat (limited to 'gold/options.cc')
-rw-r--r-- | gold/options.cc | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/gold/options.cc b/gold/options.cc index 1c0383a8d6..4e9965345f 100644 --- a/gold/options.cc +++ b/gold/options.cc @@ -341,7 +341,19 @@ void General_options::parse_library(const char*, const char* arg, Command_line* cmdline) { - Input_file_argument file(arg, true, "", false, *this); + Input_file_argument::Input_file_type type; + const char *name; + if (arg[0] == ':') + { + type = Input_file_argument::INPUT_FILE_TYPE_SEARCHED_FILE; + name = arg + 1; + } + else + { + type = Input_file_argument::INPUT_FILE_TYPE_LIBRARY; + name = arg; + } + Input_file_argument file(name, type, "", false, *this); cmdline->inputs().add_file(file); } @@ -378,7 +390,8 @@ void General_options::parse_just_symbols(const char*, const char* arg, Command_line* cmdline) { - Input_file_argument file(arg, false, "", true, *this); + Input_file_argument file(arg, Input_file_argument::INPUT_FILE_TYPE_FILE, + "", true, *this); cmdline->inputs().add_file(file); } @@ -1157,8 +1170,9 @@ Command_line::process(int argc, const char** argv) this->position_options_.copy_from_options(this->options()); if (no_more_options || argv[i][0] != '-') { - Input_file_argument file(argv[i], false, "", false, - this->position_options_); + Input_file_argument file(argv[i], + Input_file_argument::INPUT_FILE_TYPE_FILE, + "", false, this->position_options_); this->inputs_.add_file(file); ++i; } |