/* Linker file opening and searching.
- Copyright (C) 1991-2015 Free Software Foundation, Inc.
+ Copyright (C) 1991-2016 Free Software Foundation, Inc.
This file is part of the GNU Binutils.
/* Linker needs to decompress sections. */
entry->the_bfd->flags |= BFD_DECOMPRESS;
+ /* This is a linker input BFD. */
+ entry->the_bfd->is_linker_input = 1;
+
+#ifdef ENABLE_PLUGINS
+ if (entry->flags.lto_output)
+ entry->the_bfd->lto_output = 1;
+#endif
+
/* If we are searching for this file, see if the architecture is
compatible with the output file. If it isn't, keep searching.
If we can't open the file as an object file, stop the search
bfd_object that it sets the bfd's arch and mach, which
will be needed when and if we want to bfd_create a new
one using this one as a template. */
- if (bfd_check_format (entry->the_bfd, bfd_object)
- && plugin_active_plugins_p ()
- && !no_more_claiming)
- {
- int fd = open (attempt, O_RDONLY | O_BINARY);
- if (fd >= 0)
- {
- struct ld_plugin_input_file file;
-
- file.name = attempt;
- file.offset = 0;
- file.filesize = lseek (fd, 0, SEEK_END);
- file.fd = fd;
- plugin_maybe_claim (&file, entry);
- }
- }
+ if (link_info.lto_plugin_active
+ && !no_more_claiming
+ && bfd_check_format (entry->the_bfd, bfd_object))
+ plugin_maybe_claim (entry);
#endif /* ENABLE_PLUGINS */
/* It opened OK, the format checked out, and the plugins have had
{
char *string;
- if (entry->flags.dynamic && ! link_info.relocatable)
+ if (entry->flags.dynamic && !bfd_link_relocatable (&link_info))
{
if (ldemul_open_dynamic_archive (arch, search, entry))
return TRUE;