Support .gnu.lto_.lto section in ELF files (PR 24768).
[deliverable/binutils-gdb.git] / binutils / nm.c
index fd3f73167e085defd041c04e1a3f487ed93c57f0..5d3d647843493a5ad46f00c6b561563243290682 100644 (file)
@@ -438,6 +438,10 @@ print_symdef_entry (bfd *abfd)
     }
 }
 \f
+
+/* True when we can report missing plugin error.  */
+bfd_boolean report_plugin_err = TRUE;
+
 /* Choose which symbol entries to print;
    compact them downward to get rid of the rest.
    Return the number of symbols to be printed.  */
@@ -470,9 +474,13 @@ filter_symbols (bfd *abfd, bfd_boolean is_dynamic, void *minisyms,
 
       if (sym->name[0] == '_'
          && sym->name[1] == '_'
-         && strcmp (sym->name + (sym->name[2] == '_'), "__gnu_lto_slim") == 0)
-       non_fatal (_("%s: plugin needed to handle lto object"),
-                  bfd_get_filename (abfd));
+         && strcmp (sym->name + (sym->name[2] == '_'), "__gnu_lto_slim") == 0
+         && report_plugin_err)
+       {
+         report_plugin_err = FALSE;
+         non_fatal (_("%s: plugin needed to handle lto object"),
+                    bfd_get_filename (abfd));
+       }
 
       if (undefined_only)
        keep = bfd_is_und_section (sym->section);
@@ -1164,6 +1172,15 @@ display_rel_file (bfd *abfd, bfd *archive_bfd)
        }
     }
 
+  /* lto_slim_object is set to false when a bfd is loaded with a compiler
+     LTO plugin.  */
+  if (abfd->lto_slim_object)
+    {
+      report_plugin_err = FALSE;
+      non_fatal (_("%s: plugin needed to handle lto object"),
+                bfd_get_filename (abfd));
+    }
+
   /* Discard the symbols we don't want to print.
      It's OK to do this in place; we'll free the storage anyway
      (after printing).  */
This page took 0.026236 seconds and 4 git commands to generate.