MA 02110-1301, USA. */
#include "config.h"
+#include "bfd.h"
+
+#if BFD_SUPPORTS_PLUGINS
+
#include <assert.h>
#include <dlfcn.h>
#include <stdarg.h>
#define bfd_plugin_bfd_discard_group bfd_generic_discard_group
#define bfd_plugin_section_already_linked _bfd_generic_section_already_linked
#define bfd_plugin_bfd_define_common_symbol bfd_generic_define_common_symbol
+#define bfd_plugin_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type
static enum ld_plugin_status
message (int level ATTRIBUTE_UNUSED,
while ((ent = readdir (d)))
{
char *full_name;
- if (ent->d_type != DT_REG && ent->d_type != DT_LNK)
- continue;
+ struct stat s;
full_name = concat (p, "/", ent->d_name, NULL);
- found = try_load_plugin (full_name);
+ if (stat(full_name, &s) == 0 && S_ISREG (s.st_mode))
+ found = try_load_plugin (full_name);
free (full_name);
if (found)
break;
if (abfd->iostream)
{
- file.fd = fileno (abfd->iostream);
+ file.fd = fileno ((FILE *) abfd->iostream);
file.offset = 0;
file.filesize = 0; /*FIXME*/
}
{
bfd *archive = abfd->my_archive;
BFD_ASSERT (archive);
- file.fd = fileno (archive->iostream);
+ file.fd = fileno ((FILE *) archive->iostream);
file.offset = abfd->origin;
file.filesize = arelt_size (abfd);
return 0;
}
+static int
+bfd_plugin_core_file_pid (bfd *abfd ATTRIBUTE_UNUSED)
+{
+ BFD_ASSERT (0);
+ return 0;
+}
+
static long
bfd_plugin_get_symtab_upper_bound (bfd *abfd)
{
static asymbol *
bfd_plugin_make_empty_symbol (bfd *abfd)
{
- asymbol *new = bfd_zalloc (abfd, sizeof (asymbol));
- if (new == NULL)
- return new;
- new->the_bfd = abfd;
- return new;
+ asymbol *new_symbol = bfd_zalloc (abfd, sizeof (asymbol));
+ if (new_symbol == NULL)
+ return new_symbol;
+ new_symbol->the_bfd = abfd;
+ return new_symbol;
}
static int
NULL /* backend_data. */
};
+#endif /* BFD_SUPPORTS_PLUGIN */