Set BFD target to "plugin" for "nm --plugin".
authorH.J. Lu <hjl.tools@gmail.com>
Sun, 3 Oct 2010 10:49:19 +0000 (10:49 +0000)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 3 Oct 2010 10:49:19 +0000 (10:49 +0000)
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.

binutils/ChangeLog
binutils/nm.c

index e8ea6badb9991f44d2eecf150ad58d30f91ddc63..6dfe6ee2eccaec17778ecba3bd8062cd2076ac35 100644 (file)
@@ -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.
index 0ee7deb4d39fd5aa762737fe58cba012e119f165..862b2b95ae76ef526a2591f8b4781a8cb4628d69 100644 (file)
@@ -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"));
This page took 0.027392 seconds and 4 git commands to generate.