aboutsummaryrefslogtreecommitdiff
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
commitce3c775b8fa618c3002c7017de162f51d022960d (patch)
tree7dad759c178e50a24b83ef0fec8f5e79c9901042 /binutils/nm.c
parent00f3247a62aa73c2cd8f80d8d8614a89bc417301 (diff)
downloadgdb-ce3c775b8fa618c3002c7017de162f51d022960d.zip
gdb-ce3c775b8fa618c3002c7017de162f51d022960d.tar.gz
gdb-ce3c775b8fa618c3002c7017de162f51d022960d.tar.bz2
* 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 e11568a..b03d1b6 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;