Fix build breakage when ld plugins disabled
authorAlan Modra <amodra@gmail.com>
Tue, 12 Aug 2014 09:59:33 +0000 (19:29 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 12 Aug 2014 11:19:58 +0000 (20:49 +0930)
* ldlang.h (struct lang_input_statement_flags): Don't make "reload"
field conditional on ENABLE_PLUGINS.
* ldlang.c (open_input_bfds): Expand plugin_should_reload.
* plugin.h (plugin_should_reload): Delete.
* plugin.c (plugin_should_reload): Delete.

ld/ChangeLog
ld/ldlang.c
ld/ldlang.h
ld/plugin.c
ld/plugin.h

index ade3a40..ff161da 100644 (file)
@@ -1,5 +1,13 @@
 2014-08-12  Alan Modra  <amodra@gmail.com>
 
+       * ldlang.h (struct lang_input_statement_flags): Don't make "reload"
+       field conditional on ENABLE_PLUGINS.
+       * ldlang.c (open_input_bfds): Expand plugin_should_reload.
+       * plugin.h (plugin_should_reload): Delete.
+       * plugin.c (plugin_should_reload): Delete.
+
+2014-08-12  Alan Modra  <amodra@gmail.com>
+
        * ldmain.c (notice): Update args.
        * plugin.c (plugin_notice): Likewise.  Follow warning sym link.
        Handle new indirect symbol.
index 5e10c4a..9ca086d 100644 (file)
@@ -3287,7 +3287,9 @@ open_input_bfds (lang_statement_union_type *s, enum open_bfd_mode mode)
                      || (bfd_get_format (abfd) == bfd_object
                          && ((abfd->flags) & DYNAMIC) != 0
                          && s->input_statement.flags.add_DT_NEEDED_for_regular
-                         && plugin_should_reload (abfd))))
+                         && bfd_get_flavour (abfd) == bfd_target_elf_flavour
+                         && (bfd_elf_get_dyn_lib_class (abfd)
+                             & DYN_AS_NEEDED) != 0)))
                {
                  s->input_statement.flags.loaded = FALSE;
                  s->input_statement.flags.reload = TRUE;
index 45420cd..2afe283 100644 (file)
@@ -272,15 +272,15 @@ struct lang_input_statement_flags
   /* Set if the file does not exist.  */
   unsigned int missing_file : 1;
 
+  /* Set if reloading an archive or --as-needed lib.  */
+  unsigned int reload : 1;
+
 #ifdef ENABLE_PLUGINS
   /* Set if the file was claimed by a plugin.  */
   unsigned int claimed : 1;
 
   /* Set if the file was claimed from an archive.  */
   unsigned int claim_archive : 1;
-
-  /* Set if reloading an archive or --as-needed lib.  */
-  unsigned int reload : 1;
 #endif /* ENABLE_PLUGINS */
 
   /* Head of list of pushed flags.  */
index 8cca7d0..652cde1 100644 (file)
@@ -1045,12 +1045,3 @@ plugin_notice (struct bfd_link_info *info,
                                      abfd, section, value, flags);
   return TRUE;
 }
-
-/* Return true if ABFD, a dynamic library, should be reloaded.  */
-
-bfd_boolean
-plugin_should_reload (bfd *abfd)
-{
-  return (bfd_get_flavour (abfd) == bfd_target_elf_flavour
-         && (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0);
-}
index 1e239ca..bccbee3 100644 (file)
@@ -66,7 +66,4 @@ extern void plugin_call_cleanup (void);
    add_symbols hook has been called so that it can be read when linking.  */
 extern bfd *plugin_get_ir_dummy_bfd (const char *name, bfd *template);
 
-/* Return true if ABFD, a dynamic library, should be reloaded.  */
-extern bfd_boolean plugin_should_reload (bfd *);
-
 #endif /* !def GLD_PLUGIN_H */