public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Fix build breakage when ld plugins disabled
@ 2014-08-12 13:05 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2014-08-12 13:05 UTC (permalink / raw)
  To: binutils

	* 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.

diff --git a/ld/ldlang.c b/ld/ldlang.c
index 5e10c4a..9ca086d 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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;
diff --git a/ld/ldlang.h b/ld/ldlang.h
index 45420cd..2afe283 100644
--- a/ld/ldlang.h
+++ b/ld/ldlang.h
@@ -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.  */
diff --git a/ld/plugin.c b/ld/plugin.c
index 8cca7d0..652cde1 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -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);
-}
diff --git a/ld/plugin.h b/ld/plugin.h
index 1e239ca..bccbee3 100644
--- a/ld/plugin.h
+++ b/ld/plugin.h
@@ -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 */

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-12 13:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-12 13:05 Fix build breakage when ld plugins disabled Alan Modra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).