diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2020-02-25 03:30:33 -0800 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2020-02-25 03:31:40 -0800 |
commit | ecda90163e2b0a6f0be96e3fc262c28820a27211 (patch) | |
tree | 7d5371a80bf0df07028f0f107a4d70927040e089 /bfd/plugin.c | |
parent | 265b467340e5334a682e47a0e1b69a80c4428349 (diff) | |
download | gdb-ecda90163e2b0a6f0be96e3fc262c28820a27211.zip gdb-ecda90163e2b0a6f0be96e3fc262c28820a27211.tar.gz gdb-ecda90163e2b0a6f0be96e3fc262c28820a27211.tar.bz2 |
Don't call lto-wrapper for ar and ranlib
Since ar and ranlib don't need to know symbol types to work properly,
we should avoid calling lto-wrapper for them to speed them up.
bfd/
PR binutils/25584
* plugin.c (need_lto_wrapper_p): New.
(bfd_plugin_set_program_name): Add an int argument to set
need_lto_wrapper_p.
(get_lto_wrapper): Return FALSE if need_lto_wrapper_p isn't
set.
* plugin.h (bfd_plugin_set_program_name): Add an int argument.
binutils/
PR binutils/25584
* ar.c (main): Pass 0 to bfd_plugin_set_program_name.
* nm.c (main): Pass 1 to bfd_plugin_set_program_name.
Diffstat (limited to 'bfd/plugin.c')
-rw-r--r-- | bfd/plugin.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/bfd/plugin.c b/bfd/plugin.c index 93d562b..c79468f 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c @@ -147,6 +147,17 @@ struct plugin_list_entry bfd_boolean initialized; }; +static const char *plugin_program_name; +static int need_lto_wrapper_p; + +void +bfd_plugin_set_program_name (const char *program_name, + int need_lto_wrapper) +{ + plugin_program_name = program_name; + need_lto_wrapper_p = need_lto_wrapper; +} + /* Use GCC LTO wrapper to covert LTO IR object to the real object. */ static bfd_boolean @@ -165,6 +176,9 @@ get_lto_wrapper (struct plugin_list_entry *plugin) char dir_seperator = '\0'; char *resolution_file; + if (!need_lto_wrapper_p) + return FALSE; + if (plugin->initialized) { if (plugin->lto_wrapper) @@ -489,14 +503,6 @@ add_symbols (void * handle, return LDPS_OK; } -static const char *plugin_program_name; - -void -bfd_plugin_set_program_name (const char *program_name) -{ - plugin_program_name = program_name; -} - int bfd_plugin_open_input (bfd *ibfd, struct ld_plugin_input_file *file) { |