aboutsummaryrefslogtreecommitdiff
path: root/binutils/nm.c
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/nm.c')
-rw-r--r--binutils/nm.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/binutils/nm.c b/binutils/nm.c
index 7ef5d61..dce9207 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -36,9 +36,8 @@
#include "libcoff.h"
#include "bucomm.h"
#include "demanguse.h"
-#include "plugin-api.h"
-#include "plugin.h"
#include "safe-ctype.h"
+#include "plugin.h"
#ifndef streq
#define streq(a,b) (strcmp ((a),(b)) == 0)
@@ -221,11 +220,6 @@ static char other_format[] = "%02x";
static char desc_format[] = "%04x";
static char *target = NULL;
-#if BFD_SUPPORTS_PLUGINS
-static const char *plugin_target = "plugin";
-#else
-static const char *plugin_target = NULL;
-#endif
typedef enum unicode_display_type
{
@@ -343,10 +337,9 @@ usage (FILE *stream, int status)
-P, --portability Same as --format=posix\n"));
fprintf (stream, _("\
-r, --reverse-sort Reverse the sense of the sort\n"));
-#if BFD_SUPPORTS_PLUGINS
- fprintf (stream, _("\
+ if (bfd_plugin_enabled ())
+ fprintf (stream, _("\
--plugin NAME Load the specified plugin\n"));
-#endif
fprintf (stream, _("\
-S, --print-size Print size of defined symbols\n"));
fprintf (stream, _("\
@@ -801,10 +794,8 @@ filter_symbols (bfd *abfd, bool is_dynamic, void *minisyms,
if (sym == NULL)
continue;
- if (sym->name != NULL
- && sym->name[0] == '_'
- && sym->name[1] == '_'
- && strcmp (sym->name + (sym->name[2] == '_'), "__gnu_lto_slim") == 0
+ if (bfd_lto_slim_symbol_p (abfd, sym->name)
+ && !bfd_plugin_target_p (abfd->xvec)
&& report_plugin_err)
{
report_plugin_err = false;
@@ -1487,7 +1478,8 @@ display_rel_file (bfd *abfd, bfd *archive_bfd)
/* lto_type is set to lto_non_ir_object when a bfd is loaded with a
compiler LTO plugin. */
- if (bfd_get_lto_type (abfd) == lto_slim_ir_object)
+ if (bfd_get_lto_type (abfd) == lto_slim_ir_object
+ && !bfd_plugin_target_p (abfd->xvec))
{
report_plugin_err = false;
non_fatal (_("%s: plugin needed to handle lto object"),
@@ -1645,7 +1637,7 @@ display_file (char *filename)
if (get_file_size (filename) < 1)
return false;
- file = bfd_openr (filename, target ? target : plugin_target);
+ file = bfd_openr (filename, target);
if (file == NULL)
{
bfd_nonfatal (filename);
@@ -1988,9 +1980,7 @@ main (int argc, char **argv)
program_name = *argv;
xmalloc_set_program_name (program_name);
bfd_set_error_program_name (program_name);
-#if BFD_SUPPORTS_PLUGINS
bfd_plugin_set_program_name (program_name);
-#endif
expandargv (&argc, &argv);
@@ -2137,11 +2127,9 @@ main (int argc, char **argv)
break;
case OPTION_PLUGIN: /* --plugin */
-#if BFD_SUPPORTS_PLUGINS
+ if (!bfd_plugin_enabled ())
+ fatal (_("sorry - this program has been built without plugin support\n"));
bfd_plugin_set_plugin (optarg);
-#else
- fatal (_("sorry - this program has been built without plugin support\n"));
-#endif
break;
case OPTION_IFUNC_CHARS: