summaryrefslogtreecommitdiff
path: root/bfd/plugin.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-05-28 11:30:49 +0000
committerNick Clifton <nickc@redhat.com>2009-05-28 11:30:49 +0000
commit5c52c2f889768c9056378d7c951d59653370debb (patch)
treef42631905e1c6912179ddde512490f73d8fbf7a4 /bfd/plugin.c
parentd9ff23789be851983b56d64da17aeaf76b90b641 (diff)
downloadbinutils-redhat-5c52c2f889768c9056378d7c951d59653370debb.tar.gz
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-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.
Diffstat (limited to 'bfd/plugin.c')
-rw-r--r--bfd/plugin.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/bfd/plugin.c b/bfd/plugin.c
index 49395e8cb7..ca47ab620f 100644
--- a/bfd/plugin.c
+++ b/bfd/plugin.c
@@ -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);