summaryrefslogtreecommitdiff
path: root/binutils/nm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-05-26 14:12:03 +0000
committerNick Clifton <nickc@redhat.com>2009-05-26 14:12:03 +0000
commitdbda9fe8a210d33b08c1674edb956b475f31214a (patch)
tree8fc0193b2ab9f71974023c159706676d5ee94d91 /binutils/nm.c
parent15b9bbaeb4c967ce4f04a331764aebd2cb59e4fb (diff)
downloadbinutils-redhat-dbda9fe8a210d33b08c1674edb956b475f31214a.tar.gz
* Makefile.am: Run "make dep-am".
(AM_CPPFLAGS): New. (LIBDL): New. (ALL_MACHINES): Add cpu-plugin.lo. (ALL_MACHINES_CFILES): Add cpu-plugin.c. (BFD32_BACKENDS): Add plugin.lo. (BFD32_BACKENDS_CFILES): Add plugin.c. (libbfd_la_LIBADD): Add LIBDL * archures.c (bfd_architecture): Add bfd_arch_plugin. (bfd_plugin_arch): Declare. * bfd-in.h (BFD_SUPPORTS_PLUGINS): New. * bfd.c (bfd): Add plugin_data. * config.bfd: Handle the plugin target. * configure.in: Check for --enable-plugins. (LT_INIT): Use the dlopen option. * cpu-plugin.c: New. * plugin.c: New. * plugin.h: New. * targets.c (plugin_vec): Declare. (_bfd_target_vector): Add plugin_vec. * Makefile.in: Regenerate. * bfd-in2.h: Regenerate. * configure: Regenerate. * ar.c: Include plugin.h. (main): Handle the --plugin option. * nm.c: Include plugin.h. (OPTION_PLUGIN): New. (long_options): Add plugin. (main): Handle OPTION_PLUGIN. * NEWS: Mention the new feature. * doc/binutils: Documement the new command line options. * configure.in: Check for --enable-plugins. * configure: Regenerate.
Diffstat (limited to 'binutils/nm.c')
-rw-r--r--binutils/nm.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/binutils/nm.c b/binutils/nm.c
index e11568ab33..b03d1b6aad 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -1,6 +1,6 @@
/* nm.c -- Describe symbol table of a rel file.
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2007
+ 2001, 2002, 2003, 2004, 2005, 2007, 2009
Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -31,6 +31,7 @@
#include "elf-bfd.h"
#include "elf/common.h"
#include "bucomm.h"
+#include "plugin.h"
/* When sorting by size, we use this structure to hold the size and a
pointer to the minisymbol. */
@@ -178,6 +179,7 @@ static bfd *lineno_cache_bfd;
static bfd *lineno_cache_rel_bfd;
#define OPTION_TARGET 200
+#define OPTION_PLUGIN 201
static struct option long_options[] =
{
@@ -192,6 +194,7 @@ static struct option long_options[] =
{"no-demangle", no_argument, &do_demangle, 0},
{"no-sort", no_argument, &no_sort, 1},
{"numeric-sort", no_argument, &sort_numerically, 1},
+ {"plugin", required_argument, 0, OPTION_PLUGIN},
{"portability", no_argument, 0, 'P'},
{"print-armap", no_argument, &print_armap, 1},
{"print-file-name", no_argument, 0, 'o'},
@@ -237,8 +240,11 @@ usage (FILE *stream, int status)
-o Same as -A\n\
-p, --no-sort Do not sort the symbols\n\
-P, --portability Same as --format=posix\n\
- -r, --reverse-sort Reverse the sense of the sort\n\
- -S, --print-size Print size of defined symbols\n\
+ -r, --reverse-sort Reverse the sense of the sort\n"
+#if BFD_SUPPORTS_PLUGINS
+" --plugin NAME Load the specified plugin\n"
+#endif
+" -S, --print-size Print size of defined symbols\n\
-s, --print-armap Include index for symbols from archive members\n\
--size-sort Sort symbols by size\n\
--special-syms Include special symbols in the output\n\
@@ -1608,6 +1614,14 @@ main (int argc, char **argv)
target = optarg;
break;
+ case OPTION_PLUGIN: /* --plugin */
+#if BFD_SUPPORTS_PLUGINS
+ bfd_plugin_set_plugin (optarg);
+#else
+ fatal (_("sorry - this program has been built without plugin support\n"));
+#endif
+ break;
+
case 0: /* A long option that just sets a flag. */
break;