This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] Fix creating of non svr4 libraries
- From: Tristan Gingold <gingold at adacore dot com>
- To: "binutils at sourceware dot org Development" <binutils at sourceware dot org>
- Date: Fri, 17 Oct 2014 14:04:11 +0200
- Subject: [PATCH] Fix creating of non svr4 libraries
- Authentication-results: sourceware.org; auth=none
Hello,
ar.c:open_inarch sets the target from plugin_target too early. Therefore by
default, archives are created using the 'plugin' format instead of the archive
format corresponding to .o.
This isn't a problem on many targets (such as linux) because the format is the
same, but on targets having a different format (such as AIX), the created
archives are using a wrong format.
Please, be careful when reviewing that patch, I haven't tested it with a plugin
setup. But for sure, the current behaviour isn't correct.
Ok for trunk ? Will be ported on the 2.25 branch.
Tristan.
binutils/
2014-10-17 Tristan Gingold <gingold@adacore.com>
PR binutils/14698
* ar.c (open_inarch): Move code that set target from plugin_target.
diff --git a/binutils/ar.c b/binutils/ar.c
index ebd9528..d5b1e01 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -865,9 +865,6 @@ open_inarch (const char *archive_filename, const char *file)
bfd_set_error (bfd_error_no_error);
- if (target == NULL)
- target = plugin_target;
-
if (stat (archive_filename, &sbuf) != 0)
{
#if !defined(__GO32__) || defined(__DJGPP__)
@@ -919,6 +916,9 @@ open_inarch (const char *archive_filename, const char *file)
output_filename = archive_filename;
}
+ if (target == NULL)
+ target = plugin_target;
+
arch = bfd_openr (archive_filename, target);
if (arch == NULL)
{