This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb/hjl/pr17878] Call plugin_maybe_claim on unknown input


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3ce52f25e844a88f26535af29642d627602551a1

commit 3ce52f25e844a88f26535af29642d627602551a1
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Jan 26 16:42:27 2015 -0800

    Call plugin_maybe_claim on unknown input

Diff:
---
 ld/ldfile.c | 7 ++++---
 ld/plugin.c | 3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/ld/ldfile.c b/ld/ldfile.c
index f33bc9d..7351b78 100644
--- a/ld/ldfile.c
+++ b/ld/ldfile.c
@@ -301,9 +301,10 @@ success:
      bfd_object that it sets the bfd's arch and mach, which
      will be needed when and if we want to bfd_create a new
      one using this one as a template.  */
-  if (bfd_check_format (entry->the_bfd, bfd_object)
-      && plugin_active_plugins_p ()
-      && !no_more_claiming)
+  if (plugin_active_plugins_p ()
+      && !no_more_claiming
+      && (bfd_check_format (entry->the_bfd, bfd_object)
+	  || !bfd_check_format (entry->the_bfd, bfd_core)))
     {
       int fd = open (attempt, O_RDONLY | O_BINARY);
       if (fd >= 0)
diff --git a/ld/plugin.c b/ld/plugin.c
index f6f85ba..d8fe6d8 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -255,7 +255,8 @@ plugin_get_ir_dummy_bfd (const char *name, bfd *srctemplate)
       bfd_set_arch_info (abfd, bfd_get_arch_info (srctemplate));
       bfd_set_gp_size (abfd, bfd_get_gp_size (srctemplate));
       if (bfd_make_writable (abfd)
-	  && bfd_copy_private_bfd_data (srctemplate, abfd))
+	  && (srctemplate->tdata.any == NULL
+	      || bfd_copy_private_bfd_data (srctemplate, abfd)))
 	{
 	  flagword flags;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]