bfd_boolean initialized;
};
+static const char *plugin_program_name;
+static int need_lto_wrapper_p;
+
+void
+bfd_plugin_set_program_name (const char *program_name,
+ int need_lto_wrapper)
+{
+ plugin_program_name = program_name;
+ need_lto_wrapper_p = need_lto_wrapper;
+}
+
/* Use GCC LTO wrapper to covert LTO IR object to the real object. */
static bfd_boolean
char dir_seperator = '\0';
char *resolution_file;
+ if (!need_lto_wrapper_p)
+ return FALSE;
+
if (plugin->initialized)
{
if (plugin->lto_wrapper)
return LDPS_OK;
}
-static const char *plugin_program_name;
-
-void
-bfd_plugin_set_program_name (const char *program_name)
-{
- plugin_program_name = program_name;
-}
-
int
bfd_plugin_open_input (bfd *ibfd, struct ld_plugin_input_file *file)
{
abfd->plugin_format = bfd_plugin_yes;
result = 1;
-short_circuit:
+ short_circuit:
dlclose (plugin_handle);
return result;
}
/* There may be plugin libraries in lib/bfd-plugins. */
static int has_plugin_list = -1;
-static const bfd_target *(*ld_plugin_object_p) (bfd *);
+static bfd_cleanup (*ld_plugin_object_p) (bfd *);
static const char *plugin_name;
/* Register OBJECT_P to be used by bfd_plugin_object_p. */
void
-register_ld_plugin_object_p (const bfd_target *(*object_p) (bfd *))
+register_ld_plugin_object_p (bfd_cleanup (*object_p) (bfd *))
{
ld_plugin_object_p = object_p;
}
}
-static const bfd_target *
+static bfd_cleanup
bfd_plugin_object_p (bfd *abfd)
{
if (ld_plugin_object_p)
if (abfd->plugin_format == bfd_plugin_unknown && !load_plugin (abfd))
return NULL;
- return abfd->plugin_format == bfd_plugin_yes ? abfd->xvec : NULL;
+ return abfd->plugin_format == bfd_plugin_yes ? _bfd_no_cleanup : NULL;
}
/* Copy any private info we understand from the input bfd