aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2010-10-03 10:49:19 +0000
committerH.J. Lu <hjl.tools@gmail.com>2010-10-03 10:49:19 +0000
commita4b8af353975485fc9c8b9cfd7b199729420fd0d (patch)
tree27cd3ed2b498cdc2294b13fcfac10a026b842b8c /binutils
parentdc14d28a1f1f036a08d211a215efe0fdde2da80e (diff)
downloadgdb-a4b8af353975485fc9c8b9cfd7b199729420fd0d.zip
gdb-a4b8af353975485fc9c8b9cfd7b199729420fd0d.tar.gz
gdb-a4b8af353975485fc9c8b9cfd7b199729420fd0d.tar.bz2
Set BFD target to "plugin" for "nm --plugin".
2010-10-03 H.J. Lu <hongjiu.lu@intel.com> PR binutils/12088 * nm.c (plugin_target): New. (main): Set plugin_target to "plugin" for --plugin. (display_file): Pass plugin_target to bfd_openr if target isn't set.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog8
-rw-r--r--binutils/nm.c4
2 files changed, 11 insertions, 1 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index e8ea6ba..6dfe6ee 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,11 @@
+2010-10-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR binutils/12088
+ * nm.c (plugin_target): New.
+ (main): Set plugin_target to "plugin" for --plugin.
+ (display_file): Pass plugin_target to bfd_openr if target
+ isn't set.
+
2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* configure: Regenerate.
diff --git a/binutils/nm.c b/binutils/nm.c
index 0ee7deb..862b2b9 100644
--- a/binutils/nm.c
+++ b/binutils/nm.c
@@ -173,6 +173,7 @@ static char other_format[] = "%02x";
static char desc_format[] = "%04x";
static char *target = NULL;
+static char *plugin_target = NULL;
/* Used to cache the line numbers for a BFD. */
static bfd *lineno_cache_bfd;
@@ -1183,7 +1184,7 @@ display_file (char *filename)
if (get_file_size (filename) < 1)
return FALSE;
- file = bfd_openr (filename, target);
+ file = bfd_openr (filename, target ? target : plugin_target);
if (file == NULL)
{
bfd_nonfatal (filename);
@@ -1621,6 +1622,7 @@ main (int argc, char **argv)
case OPTION_PLUGIN: /* --plugin */
#if BFD_SUPPORTS_PLUGINS
+ plugin_target = "plugin";
bfd_plugin_set_plugin (optarg);
#else
fatal (_("sorry - this program has been built without plugin support\n"));