diff options
author | Ian Lance Taylor <ian@airs.com> | 2009-10-06 20:15:09 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2009-10-06 20:15:09 +0000 |
commit | e99daf92c2ee344adf7c88920f50744ace6a5b22 (patch) | |
tree | c9785c15f090fcc7d63f7944035d0abcac09427e /gold | |
parent | 8341e15b3424b7f42b101a93fa69abf9ede78d30 (diff) | |
download | gdb-e99daf92c2ee344adf7c88920f50744ace6a5b22.zip gdb-e99daf92c2ee344adf7c88920f50744ace6a5b22.tar.gz gdb-e99daf92c2ee344adf7c88920f50744ace6a5b22.tar.bz2 |
* plugin.cc (add_input_library): New.
(Plugin::load): Add add_input_library to tv.
(Plugin_manager::add_input_file): Add the is_lib argument.
(add_input_file): Update call to Plugin_manager::add_input_file.
(add_input_library): New.
* plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
Diffstat (limited to 'gold')
-rw-r--r-- | gold/ChangeLog | 9 | ||||
-rw-r--r-- | gold/plugin.cc | 24 | ||||
-rw-r--r-- | gold/plugin.h | 2 |
3 files changed, 30 insertions, 5 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog index 8068a64..4840179 100644 --- a/gold/ChangeLog +++ b/gold/ChangeLog @@ -1,3 +1,12 @@ +2009-10-06 Rafael Espindola <espindola@google.com> + + * plugin.cc (add_input_library): New. + (Plugin::load): Add add_input_library to tv. + (Plugin_manager::add_input_file): Add the is_lib argument. + (add_input_file): Update call to Plugin_manager::add_input_file. + (add_input_library): New. + * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument. + 2009-09-30 Doug Kwan <dougkwan@google.com> * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function diff --git a/gold/plugin.cc b/gold/plugin.cc index 4df405f..ccbcffd 100644 --- a/gold/plugin.cc +++ b/gold/plugin.cc @@ -74,6 +74,9 @@ static enum ld_plugin_status add_input_file(char *pathname); static enum ld_plugin_status +add_input_library(char *pathname); + +static enum ld_plugin_status message(int level, const char *format, ...); }; @@ -118,7 +121,7 @@ Plugin::load() sscanf(ver, "%d.%d", &major, &minor); // Allocate and populate a transfer vector. - const int tv_fixed_size = 13; + const int tv_fixed_size = 14; int tv_size = this->args_.size() + tv_fixed_size; ld_plugin_tv *tv = new ld_plugin_tv[tv_size]; @@ -185,6 +188,10 @@ Plugin::load() tv[i].tv_u.tv_add_input_file = add_input_file; ++i; + tv[i].tv_tag = LDPT_ADD_INPUT_LIBRARY; + tv[i].tv_u.tv_add_input_library = add_input_library; + + ++i; tv[i].tv_tag = LDPT_NULL; tv[i].tv_u.tv_val = 0; @@ -401,9 +408,9 @@ Plugin_manager::release_input_file(unsigned int handle) // Add a new input file. ld_plugin_status -Plugin_manager::add_input_file(char *pathname) +Plugin_manager::add_input_file(char *pathname, bool is_lib) { - Input_file_argument file(pathname, false, "", false, this->options_); + Input_file_argument file(pathname, is_lib, "", false, this->options_); Input_argument* input_argument = new Input_argument(file); Task_token* next_blocker = new Task_token(true); next_blocker->add_blocker(); @@ -941,7 +948,16 @@ static enum ld_plugin_status add_input_file(char *pathname) { gold_assert(parameters->options().has_plugins()); - return parameters->options().plugins()->add_input_file(pathname); + return parameters->options().plugins()->add_input_file(pathname, false); +} + +// Add a new (real) library required by a plugin. + +static enum ld_plugin_status +add_input_library(char *pathname) +{ + gold_assert(parameters->options().has_plugins()); + return parameters->options().plugins()->add_input_file(pathname, true); } // Issue a diagnostic message from a plugin. diff --git a/gold/plugin.h b/gold/plugin.h index 6a98ac8..965b389 100644 --- a/gold/plugin.h +++ b/gold/plugin.h @@ -227,7 +227,7 @@ class Plugin_manager // Add a new input file. ld_plugin_status - add_input_file(char *pathname); + add_input_file(char *pathname, bool is_lib); // Return TRUE if we are in the replacement phase. bool |