It isn't needed anywhere except plugin.c. The typedef can disappear.
Also make a forward declaraion for ld_plugin_input_file in plugin.h
so that this header can be used without first including plugin-api.h.
bfd/
* plugin.h (struct ld_plugin_input_file): Forward declare.
(struct plugin_data_struct): Move to..
* plugin.c: ..here.
(add_symbols): Size plugin_data without using type.
* archive.c: Don't include plugin-api.h.
* elflink.c: Likewise.
* format.c: Likewise.
binutils/
* ar.c: Don't include plugin-api.h or ansidecl.h. Only
include plugin.h when BFD_SUPPORTS_PLUGINS.
* nm.c: Don't include plugin-api.h. Only include plugin.h
when BFD_SUPPORTS_PLUGINS.
* objcopy.c: Likewise.
ld/
* ldfile.c: Don't include plugin-api.h.
* ldmain.c: Likewise.
#include "filenames.h"
#include "bfdlink.h"
#if BFD_SUPPORTS_PLUGINS
-#include "plugin-api.h"
#include "plugin.h"
#endif
#include "libiberty.h"
#include "objalloc.h"
#if BFD_SUPPORTS_PLUGINS
-#include "plugin-api.h"
#include "plugin.h"
#endif
#include "bfd.h"
#include "libbfd.h"
#if BFD_SUPPORTS_PLUGINS
-#include "plugin-api.h"
#include "plugin.h"
#endif
const char *plugin_name;
};
+struct plugin_data_struct
+{
+ int nsyms;
+ const struct ld_plugin_symbol *syms;
+ int object_only_nsyms;
+ asymbol **object_only_syms;
+};
+
static const char *plugin_program_name;
void
const struct ld_plugin_symbol * syms)
{
bfd *abfd = handle;
- struct plugin_data_struct *plugin_data =
- bfd_alloc (abfd, sizeof (plugin_data_struct));
-
+ struct plugin_data_struct *plugin_data = bfd_alloc (abfd,
+ sizeof (*plugin_data));
if (!plugin_data)
return LDPS_ERR;
#ifndef _PLUGIN_H_
#define _PLUGIN_H_
+struct ld_plugin_input_file;
+
void bfd_plugin_set_program_name (const char *);
int bfd_plugin_open_input (bfd *, struct ld_plugin_input_file *);
void bfd_plugin_set_plugin (const char *);
void register_ld_plugin_object_p (bfd_cleanup (*object_p) (bfd *, bool));
void bfd_plugin_close_file_descriptor (bfd *, int);
-typedef struct plugin_data_struct
-{
- int nsyms;
- const struct ld_plugin_symbol *syms;
- int object_only_nsyms;
- asymbol **object_only_syms;
-}
-plugin_data_struct;
-
#endif
#include "arsup.h"
#include "filenames.h"
#include "binemul.h"
-#include "plugin-api.h"
+#if BFD_SUPPORTS_PLUGINS
#include "plugin.h"
-#include "ansidecl.h"
+#endif
#ifdef __GO32___
#define EXT_NAME_LEN 3 /* Bufflen of addition to name if it's MS-DOS. */
#include "libcoff.h"
#include "bucomm.h"
#include "demanguse.h"
-#include "plugin-api.h"
-#include "plugin.h"
#include "safe-ctype.h"
+#if BFD_SUPPORTS_PLUGINS
+#include "plugin.h"
+#endif
#ifndef streq
#define streq(a,b) (strcmp ((a),(b)) == 0)
#include "coff/internal.h"
#include "libcoff.h"
#include "safe-ctype.h"
-#include "plugin-api.h"
+#if BFD_SUPPORTS_PLUGINS
#include "plugin.h"
+#endif
/* FIXME: See bfd/peXXigen.c for why we include an architecture specific
header in generic PE code. */
#include "filenames.h"
#include <fnmatch.h>
#if BFD_SUPPORTS_PLUGINS
-#include "plugin-api.h"
#include "plugin.h"
#endif /* BFD_SUPPORTS_PLUGINS */
#include "ldctor.h"
#if BFD_SUPPORTS_PLUGINS
#include "plugin.h"
-#include "plugin-api.h"
#endif /* BFD_SUPPORTS_PLUGINS */
/* Somewhere above, sys/stat.h got included. */