aboutsummaryrefslogtreecommitdiff
path: root/bfd/plugin.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2016-06-20 05:10:29 -0700
committerH.J. Lu <hjl.tools@gmail.com>2016-06-20 05:10:46 -0700
commit7dc3990e4002e0062007c1d41b56e04b5b8ec1ec (patch)
tree4e2190341e363ae4dac71d031c109ffd265aba04 /bfd/plugin.c
parent9f99c22eb74a66e691b778cd15c24437f46d5818 (diff)
downloadgdb-7dc3990e4002e0062007c1d41b56e04b5b8ec1ec.zip
gdb-7dc3990e4002e0062007c1d41b56e04b5b8ec1ec.tar.gz
gdb-7dc3990e4002e0062007c1d41b56e04b5b8ec1ec.tar.bz2
Use the IR symbol table for the IR input object
ELF linker shouldn't skip the IR object when searching the symbol table of an archive element. If linker doesn't know if the object file is an IR object, it should give LTO plugin a chance to get the correct symbol table and use the IR symbol table if the input is an IR object. bfd/ PR ld/18250 PR ld/20267 * elflink.c: Include plugin.h if BFD_SUPPORTS_PLUGINS is defined. (elf_link_is_defined_archive_symbol): Call bfd_link_plugin_object_p on unknown plugin object and use the IR symbol table if the input is an IR object. * plugin.c (bfd_link_plugin_object_p): New function. * plugin.h (bfd_link_plugin_object_p): New prototype. ld/ PR ld/20267 * testsuite/ld-plugin/lto.exp (lto_link_tests): Add test for PR ld/20267. (lto_run_tests): Likewise. * testsuite/ld-plugin/pr20267a.c: New file. * testsuite/ld-plugin/pr20267b.c: Likewise.
Diffstat (limited to 'bfd/plugin.c')
-rw-r--r--bfd/plugin.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/bfd/plugin.c b/bfd/plugin.c
index 2ab3452..c66d95e 100644
--- a/bfd/plugin.c
+++ b/bfd/plugin.c
@@ -287,6 +287,16 @@ bfd_plugin_specified_p (void)
return has_plugin > 0;
}
+/* Return TRUE if ABFD can be claimed by linker LTO plugin. */
+
+bfd_boolean
+bfd_link_plugin_object_p (bfd *abfd)
+{
+ if (ld_plugin_object_p)
+ return ld_plugin_object_p (abfd) != NULL;
+ return FALSE;
+}
+
extern const bfd_target plugin_vec;
/* Return TRUE if TARGET is a pointer to plugin_vec. */