This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] PR ld/20267: Use the IR symbol table for the IR input object
- From: Joel Brobecker <brobecker at adacore dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Fri, 24 Jun 2016 10:08:00 -0700
- Subject: Re: [PATCH] PR ld/20267: Use the IR symbol table for the IR input object
- Authentication-results: sourceware.org; auth=none
- References: <20160619015635 dot GA24627 at gmail dot com>
> 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.
I believe this patch caused the GDB build to fail when configuration
without plugin support.
Attached is the patch I pushed as obvious to fix the issue.
bfd/ChangeLog:
* elflink.c: Check the value of BFD_SUPPORTS_PLUGINS rather
than its existance.
Tested on x86_64-linux.
--
Joel
>From 08ce1d723ea3360a8ae52a4a4bd395ec984563eb Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Fri, 24 Jun 2016 12:16:24 -0400
Subject: [PATCH] fix undefined reference to bfd_link_plugin_object_p during
link
When configured with the default options, GDB currently fails to link,
due to an undefined reference to bfd_link_plugin_object_p, coming from
elflink.c:
#ifdef BFD_SUPPORTS_PLUGINS
|| (abfd->plugin_format == bfd_plugin_unknown
&& bfd_link_plugin_object_p (abfd))
#endif
This is because BFD_SUPPORTS_PLUGINS is always defined. It is its value
that determines whether plugin support is enabled or not.
bfd/ChangeLog:
* elflink.c: Check the value of BFD_SUPPORTS_PLUGINS rather
than its existance.
---
bfd/elflink.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/bfd/elflink.c b/bfd/elflink.c
index bb83854..ad8493b 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -28,7 +28,7 @@
#include "safe-ctype.h"
#include "libiberty.h"
#include "objalloc.h"
-#ifdef BFD_SUPPORTS_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
#include "plugin.h"
#endif
@@ -3134,7 +3134,7 @@ elf_link_is_defined_archive_symbol (bfd * abfd, carsym * symdef)
object file is an IR object, give linker LTO plugin a chance to
get the correct symbol table. */
if (abfd->plugin_format == bfd_plugin_yes
-#ifdef BFD_SUPPORTS_PLUGINS
+#if BFD_SUPPORTS_PLUGINS
|| (abfd->plugin_format == bfd_plugin_unknown
&& bfd_link_plugin_object_p (abfd))
#endif
--
2.1.4