This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: PR binutils/13278: --plugin doesn't work on archive
- From: "H.J. Lu" <hongjiu dot lu at intel dot com>
- To: binutils at sourceware dot org
- Date: Sat, 15 Oct 2011 14:14:37 -0700
- Subject: PATCH: PR binutils/13278: --plugin doesn't work on archive
- Reply-to: "H.J. Lu" <hjl dot tools at gmail dot com>
We shouldn't set the target from the the first object on the list if
it has been set. OK to install?
Thanks.
H.J.
----
2011-10-15 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/13278
* ar.c (open_inarch): Set the target from the the first object
on the list only if it isn't set.
diff --git a/binutils/ar.c b/binutils/ar.c
index 7b3c3fa..882ef1a 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -815,9 +815,9 @@ open_inarch (const char *archive_filename, const char *file)
return NULL;
}
- /* Try to figure out the target to use for the archive from the
- first object on the list. */
- if (file != NULL)
+ /* If the target isn't set, try to figure out the target to use
+ for the archive from the first object on the list. */
+ if (target == NULL && file != NULL)
{
bfd *obj;