2009-05-28 Nick Clifton <nickc@redhat.com>
authorNick Clifton <nickc@redhat.com>
Thu, 28 May 2009 11:30:49 +0000 (11:30 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 28 May 2009 11:30:49 +0000 (11:30 +0000)
        * targets.c (_bfd_target_vector): Only include plugin target in
        all-targets build if BFD_SUPPORTS_PLUGINS is non-zero.

2009-05-27  Rafael Avila de Espindola  <espindola@google.com>

        * plugin.c (program_name): Remove.
        (plugin_program_name): New.
        (bfd_plugin_set_program_name): New.
        (try_load_plugin): Use plugin_program_name.
        * plugin.h (bfd_plugin_set_program_name): New.

2009-05-27  Rafael Avila de Espindola  <espindola@google.com>

        * ar.c (main): Call bfd_plugin_set_program_name.
        * nm.c (main): Call bfd_plugin_set_program_name.

bfd/ChangeLog
bfd/plugin.c
bfd/plugin.h
bfd/targets.c
binutils/ChangeLog
binutils/ar.c
binutils/nm.c

index 7ae22bb6e2d9f5b54fd8d3c645a3c7088f2e5f06..774dc3f66ce8fd56a7a16914087b27900e6bcb0a 100644 (file)
@@ -1,3 +1,8 @@
+2009-05-28  Nick Clifton  <nickc@redhat.com>
+
+       * targets.c (_bfd_target_vector): Only include plugin target in
+       all-targets build if BFD_SUPPORTS_PLUGINS is non-zero.
+
 2009-05-28  Ulrich Weigand  <uweigand@de.ibm.com>
 
        * elf32-spu.c (struct call_info): New member broken_cycle.
        (spu_elf_auto_overlay): Honor call counts when determining number
        of stubs required in software i-cache mode.
 
-2009-05-26  Rafael Avila de Espindola  <espindola@google.com>
+2009-05-27  Rafael Avila de Espindola  <espindola@google.com>
+
+       * plugin.c (program_name): Remove.
+       (plugin_program_name): New.
+       (bfd_plugin_set_program_name): New.
+       (try_load_plugin): Use plugin_program_name.
+       * plugin.h (bfd_plugin_set_program_name): New.
+
+2009-05-27  Rafael Avila de Espindola  <espindola@google.com>
 
        * aclocal.m4: Include ../config/plugins.m4.
        * configure.in: Use AC_PLUGINS.
index 49395e8cb7cf5ec0c205bb93e45e91a8bd3e535e..ca47ab620f25af9b44eeb676bd7567c7df988c20 100644 (file)
@@ -106,7 +106,13 @@ add_symbols (void * handle,
   return LDPS_OK;
 }
 
-extern char *program_name __attribute__ ((weak));
+static const char *plugin_program_name;
+
+void
+bfd_plugin_set_program_name (const char *program_name)
+{
+  plugin_program_name = program_name;
+}
 
 static int
 try_load_plugin (const char *pname)
@@ -180,11 +186,11 @@ load_plugin (void)
   if (plugin_name)
     return try_load_plugin (plugin_name);
 
-  if (!program_name)
+  if (plugin_program_name == NULL)
     return 0;
 
   plugin_dir = concat (BINDIR, "/../lib/bfd-plugins", NULL);
-  p = make_relative_prefix (program_name,
+  p = make_relative_prefix (plugin_program_name,
                            BINDIR,
                            plugin_dir);
   free (plugin_dir);
index 2fae2de9ceca9ed3140ada8590e6cd01f13e0f84..3091f9705a1a8522f4762ca6c874f0d355984133 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "bfd.h"
 
+void bfd_plugin_set_program_name (const char *);
 void bfd_plugin_set_plugin (const char *);
 
 typedef struct plugin_data_struct
index 6ec6a6cb6d744f6ab213109cfa18f43822029016..49aa5f1b0134418c00fd2759c71b6054d5a5d411 100644 (file)
@@ -1145,7 +1145,9 @@ static const bfd_target * const _bfd_target_vector[] =
        &pdp11_aout_vec,
        &pef_vec,
        &pef_xlib_vec,
+#if BFD_SUPPORTS_PLUGINS
        &plugin_vec,
+#endif
 #if 0
        /* This has the same magic number as RS/6000.  */
        &pmac_xcoff_vec,
index cf3eaecece9139eba5c404c54d894a4089b0de76..4acdbf937b690971b680339338e19fd6ad31b1dc 100644 (file)
@@ -3,6 +3,19 @@
        * readelf.c (display_debug_section): Do not display debug sections
        with the NOBITS section type.
 
+2009-05-27  Rafael Avila de Espindola  <espindola@google.com>
+
+       * aclocal.m4: Include ../config/plugins.m4.
+       * configure.in: Use AC_PLUGINS.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+       * doc/Makefile.in: Regenerate.
+
+2009-05-27  Rafael Avila de Espindola  <espindola@google.com>
+
+       * ar.c (main): Call bfd_plugin_set_program_name.
+       * nm.c (main): Call bfd_plugin_set_program_name.
+
 2009-05-27  Nathan Sidwell  <nathan@codesourcery.com>
 
        * sysdump.c (tab): Use puts rather than two printfs.
index d28419f4f1cafd9cb8db678f14ccfdc5df6c71fa..318cfe0cc3889750f454c724c97ac5d64fab9aad 100644 (file)
@@ -392,6 +392,9 @@ main (int argc, char **argv)
 
   program_name = argv[0];
   xmalloc_set_program_name (program_name);
+#if BFD_SUPPORTS_PLUGINS
+  bfd_plugin_set_program_name (program_name);
+#endif
 
   expandargv (&argc, &argv);
 
index b03d1b6aad4132afb6e94260b59329c32a69696c..51f67d143130a9c3003de7d9f30bb1df4d29ca72 100644 (file)
@@ -1515,6 +1515,9 @@ main (int argc, char **argv)
 
   program_name = *argv;
   xmalloc_set_program_name (program_name);
+#if BFD_SUPPORTS_PLUGINS
+  bfd_plugin_set_program_name (program_name);
+#endif
 
   START_PROGRESS (program_name, 0);