Blame SOURCES/binutils-plugin-error.patch

6eaabf
--- binutils.orig/bfd/plugin.c	2022-01-19 16:17:33.290999966 +0000
6eaabf
+++ binutils-2.30/bfd/plugin.c	2022-01-19 16:23:33.704473426 +0000
6eaabf
@@ -349,7 +349,7 @@ try_claim (bfd *abfd)
6eaabf
 }
6eaabf
 
6eaabf
 static int
6eaabf
-try_load_plugin (const char *pname, bfd *abfd, int *has_plugin_p)
6eaabf
+try_load_plugin (const char *pname, bfd *abfd, int *has_plugin_p, bfd_boolean build_list_p)
6eaabf
 {
6eaabf
   void *plugin_handle;
6eaabf
   struct ld_plugin_tv tv[4];
6eaabf
@@ -362,7 +362,11 @@ try_load_plugin (const char *pname, bfd
6eaabf
   plugin_handle = dlopen (pname, RTLD_NOW);
6eaabf
   if (!plugin_handle)
6eaabf
     {
6eaabf
-      _bfd_error_handler ("%s\n", dlerror ());
6eaabf
+      /* If we are building a list of viable plugins, then
6eaabf
+	 we do not bother the user with the details of any
6eaabf
+	 plugins that cannot be loaded.  */
6eaabf
+      if (! build_list_p)
6eaabf
+	_bfd_error_handler ("%s\n", dlerror ());
6eaabf
       return 0;
6eaabf
     }
6eaabf
 
6eaabf
@@ -477,7 +481,7 @@ load_plugin (bfd *abfd)
6eaabf
     return found;
6eaabf
 
6eaabf
   if (plugin_name)
6eaabf
-    return try_load_plugin (plugin_name, abfd, &has_plugin);
6eaabf
+    return try_load_plugin (plugin_name, abfd, &has_plugin, FALSE);
6eaabf
 
6eaabf
   if (plugin_program_name == NULL)
6eaabf
     return found;
6eaabf
@@ -501,7 +505,7 @@ load_plugin (bfd *abfd)
6eaabf
 
6eaabf
       full_name = concat (p, "/", ent->d_name, NULL);
6eaabf
       if (stat(full_name, &s) == 0 && S_ISREG (s.st_mode))
6eaabf
-	found = try_load_plugin (full_name, abfd, &valid_plugin);
6eaabf
+	found = try_load_plugin (full_name, abfd, &valid_plugin, TRUE);
6eaabf
       if (has_plugin <= 0)
6eaabf
 	has_plugin = valid_plugin;
6eaabf
       free (full_name);