Blame SOURCES/binutils-plugin-error.patch

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