This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold][patch] Add a plugin callback for setting the extra search path
- From: Ian Lance Taylor <iant at google dot com>
- To: Rafael Espindola <espindola at google dot com>
- Cc: Binutils <binutils at sourceware dot org>, Cary Coutant <ccoutant at google dot com>
- Date: Tue, 13 Jul 2010 05:15:47 -0700
- Subject: Re: [gold][patch] Add a plugin callback for setting the extra search path
- References: <AANLkTildio1BtNdPhe-MAMox0CZtX8cTuHaIOBMuenDA@mail.gmail.com>
Rafael Espindola <espindola@google.com> writes:
> include/
> 2010-06-18 Rafael Espindola <espindola@google.com>
>
> * plugin-api.h (ld_plugin_set_extra_library_path): New.
> (ld_plugin_tag): Add LDPT_SET_EXTRA_LIBRARY_PATH.
> (ld_plugin_tv): Add tv_set_extra_library_path.
>
> gold/
> 2010-06-18 Rafael Espindola <espindola@google.com>
>
> * fileread.cc (Input_file::find_fie): New
> (Input_file::open): Use Input_file::find_fie.
> * fileread.h (Input_file::find_fie): New
> * plugin.cc (set_extra_library_path): New.
> (Plugin::load): Add set_extra_library_path to the transfer vector.
> (Plugin_manager::set_extra_library_path): New.
> (Plugin_manager::add_input_file): Use the extra search path if set.
> (set_extra_library_path(): New.
> * plugin.h (Plugin_manager): Adde set_extra_library_path and
> extra_search_path_.
I see this patch got committed, but here are some formatting and style
changes. Please correct and commit. Thanks.
> +// Try to find a file in the extra search dirs. Returns true on success.
Two spaces after period.
> +static bool
> +try_extra_search_path(int *pindex, const Input_file_argument* input_argument,
> + std::string filename, std::string *found_name,
> + std::string *namep) {
Make this a static private member of Input_file.
Brace goes by itself on next line.
> + if (input_argument->extra_search_path() == NULL)
> + return false;
> +
> + std::string name = input_argument->extra_search_path();
> + if (!IS_DIR_SEPARATOR (name[name.length() - 1]))
This is C++: no space before left parenthesis.
> -bool
> -Input_file::open(const Dirsearch& dirpath, const Task* task, int *pindex)
> +static bool
> +find_file(const Dirsearch& dirpath, int *pindex,
> + const Input_file_argument* input_argument, bool *is_in_sysroot,
> + std::string *found_name, std::string *namep)
> {
Make this a static private member of Input_file.
Ian