RFC: Silence warnings about incompatible plugins
H.J. Lu
hjl.tools@gmail.com
Thu Jun 18 16:47:25 GMT 2020
On Thu, Jun 18, 2020 at 9:36 AM Nick Clifton via Binutils
<binutils@sourceware.org> wrote:
>
> Hi Guys,
>
> I have been looking at a Fedora bug report[1] from a user who was
> receiving warning messages from the BFD library about incompatible
> plugins. It turns out that they had both 32-bit and 64-bit versions
> of the same plugin installed, and the BFD library was attempting to
> load all of them.
>
> After thinking about it for a while, it seemed to me that the simplest
> solution was to not warn about incompatible plugins whilst attempting
> to create a list of viable plugins. Hence the proposed patch below.
>
> What do people think - does anyone see any problems with this approach
> ?
>
> Cheers
> Nick
>
> diff --git a/bfd/plugin.c b/bfd/plugin.c
> index 97f1c9c773..5ed8757809 100644
> --- a/bfd/plugin.c
> +++ b/bfd/plugin.c
> @@ -273,15 +274,20 @@ try_load_plugin (const char *pname,
> plugin_handle = dlopen (pname, RTLD_NOW);
> if (!plugin_handle)
> {
> - _bfd_error_handler ("Failed to load plugin '%s', reason: %s\n",
> - pname, dlerror ());
> - return 0;
> + /* If we are building a list of viable plugins, then
> + we do not bother the user with the details of any
> + plugins that cannot be loaded. */
> + if (! build_list_p)
> + _bfd_error_handler ("Failed to load plugin '%s', reason: %s\n",
> + pname, dlerror ());
> + return 0;
> }
>
> [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1836618
>
It makes sense to me.
--
H.J.
More information about the Binutils
mailing list