>From fc7521535ba78da4c5601fe98cb5b2409f61f352 Mon Sep 17 00:00:00 2001
From: Dave Korn <dave.korn.cygwin@gmail.com>
Date: Wed, 2 Feb 2011 04:11:59 +0000
Subject: [PATCH] ld/ChangeLog:

2011-02-01  Dave Korn  <...

	* plugin.c (IRONLY_SUFFIX): Delete.
	(IRONLY_SUFFIX_LEN): Likewise.
	(plugin_get_ir_dummy_bfd): Don't append IRONLY_SUFFIX.
	(is_ir_dummy_bfd): Don't look for it; check claimed flag of enclosing
	lang input statement instead.
---
 ld/plugin.c |   23 ++++-------------------
 1 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/ld/plugin.c b/ld/plugin.c
index cd8aeb9..e6cc436 100644
--- a/ld/plugin.c
+++ b/ld/plugin.c
@@ -36,15 +36,6 @@
 #include <Windows.h>
 #endif
 
-/* The suffix to append to the name of the real (claimed) object file
-   when generating a dummy BFD to hold the IR symbols sent from the
-   plugin.  */
-#define IRONLY_SUFFIX		".ironly\004"
-
-/* This is sizeof an array of chars, not sizeof a const char *.  We
-   also have to avoid inadvertently counting the trailing NUL.  */
-#define IRONLY_SUFFIX_LEN	(sizeof (IRONLY_SUFFIX) - 1)
-
 /* Stores a single argument passed to a plugin.  */
 typedef struct plugin_arg
 {
@@ -236,8 +227,7 @@ plugin_get_ir_dummy_bfd (const char *name, bfd *srctemplate)
   bfd *abfd;
 
   bfd_use_reserved_id = 1;
-  abfd = bfd_create (concat (name, IRONLY_SUFFIX, (const char *)NULL),
-		     srctemplate);
+  abfd = bfd_create (name, srctemplate);
   bfd_set_arch_info (abfd, bfd_get_arch_info (srctemplate));
   bfd_make_writable (abfd);
   bfd_copy_private_bfd_data (srctemplate, abfd);
@@ -256,14 +246,9 @@ plugin_get_ir_dummy_bfd (const char *name, bfd *srctemplate)
 static bfd_boolean
 is_ir_dummy_bfd (const bfd *abfd)
 {
-  size_t namlen;
+  ASSERT(abfd->usrdata);
+  return ((lang_input_statement_type *)(abfd->usrdata))->claimed;
 
-  if (abfd == NULL)
-    return FALSE;
-  namlen = strlen (abfd->filename);
-  if (namlen < IRONLY_SUFFIX_LEN)
-    return FALSE;
-  return !strcmp (abfd->filename + namlen - IRONLY_SUFFIX_LEN, IRONLY_SUFFIX);
 }
 
 /* Helpers to convert between BFD and GOLD symbol formats.  */
