aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-09-08 17:27:00 -0700
committerAndreas K. Hüttel <dilfridge@gentoo.org>2024-11-09 15:27:38 +0100
commitac806fe60eaea5814db7e5f9690f3f71259b2cdb (patch)
treeb30e1c0744ab1b4b075fc764d0c9e736ce06b50d
parentPR32109, aborting at bfd/bfd.c:1236 in int _bfd_doprnt (diff)
downloadbinutils-gdb-ac806fe60eaea5814db7e5f9690f3f71259b2cdb.tar.gz
binutils-gdb-ac806fe60eaea5814db7e5f9690f3f71259b2cdb.tar.bz2
binutils-gdb-ac806fe60eaea5814db7e5f9690f3f71259b2cdb.zip
bfd: Pass true to ld_plugin_object_p
Since linker calls bfd_plugin_object_p, which calls ld_plugin_object_p, only for command-line input objects, pass true to ld_plugin_object_p so that the same input IR file won't be included twice if the new LTO hook, LDPT_REGISTER_CLAIM_FILE_HOOK_V2 isn't used. PR ld/32153 * plugin.c (bfd_plugin_object_p): Pass true to ld_plugin_object_p. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> (cherry picked from commit c839a44c39161c9932d58c28c2949ab3bb94ea6f) (cherry picked from commit f307db3d8b755e7f6f6efc3157aad592a6d9ed80)
-rw-r--r--bfd/plugin.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bfd/plugin.c b/bfd/plugin.c
index f6c6fdbee69..de2137fddc4 100644
--- a/bfd/plugin.c
+++ b/bfd/plugin.c
@@ -596,8 +596,12 @@ load_plugin (bfd *abfd)
static bfd_cleanup
bfd_plugin_object_p (bfd *abfd)
{
+ /* Since ld_plugin_object_p is called only for linker command-line input
+ objects, pass true to ld_plugin_object_p so that the same input IR
+ file won't be included twice if the LDPT_REGISTER_CLAIM_FILE_HOOK_V2
+ isn't used. */
if (ld_plugin_object_p)
- return ld_plugin_object_p (abfd, false);
+ return ld_plugin_object_p (abfd, true);
if (abfd->plugin_format == bfd_plugin_unknown && !load_plugin (abfd))
return NULL;