aboutsummaryrefslogtreecommitdiff
path: root/ld/plugin.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-10-20 09:50:59 +0000
committerAlan Modra <amodra@gmail.com>2011-10-20 09:50:59 +0000
commit5468810dda30d115069fc8fa41e68ed2caa34fc1 (patch)
tree9b845296b7c99582b5873ce6ee83047c896d3389 /ld/plugin.c
parent4743b73565bcc34d3a4e41529ac4e93517465b41 (diff)
downloadgdb-5468810dda30d115069fc8fa41e68ed2caa34fc1.zip
gdb-5468810dda30d115069fc8fa41e68ed2caa34fc1.tar.gz
gdb-5468810dda30d115069fc8fa41e68ed2caa34fc1.tar.bz2
PR ld/13287
* plugin.c (plugin_should_reload): New function. * plugin.h (plugin_should_reload): Declare. * ldlang.c (open_input_bfds): Use above function.
Diffstat (limited to 'ld/plugin.c')
-rw-r--r--ld/plugin.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ld/plugin.c b/ld/plugin.c
index 5f4aa8f..91fe48b 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -1014,3 +1014,14 @@ plugin_notice (struct bfd_link_info *info,
abfd, section, value, flags, string);
return TRUE;
}
+
+/* Return true if bfd is a dynamic library that should be reloaded. */
+
+bfd_boolean
+plugin_should_reload (bfd *abfd)
+{
+ return ((abfd->flags & DYNAMIC) != 0
+ && bfd_get_flavour (abfd) == bfd_target_elf_flavour
+ && bfd_get_format (abfd) == bfd_object
+ && (elf_dyn_lib_class (abfd) & DYN_AS_NEEDED) != 0);
+}